Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not importing aleph/react breaks the build #552

Open
webpro opened this issue Apr 29, 2023 · 0 comments
Open

Not importing aleph/react breaks the build #552

webpro opened this issue Apr 29, 2023 · 0 comments

Comments

@webpro
Copy link

webpro commented Apr 29, 2023

Steps to reproduce:

deno run -A -r https://alephjs.org/init.ts  # choose "React"
cd my-app
rm routes/_app.tsx routes/_404.tsx routes/todos.tsx
deno task build && deno task start

Everything still fine. Now replace routes/index.tsx with this:

import { useReducer } from 'react';

export default function Main() {
  const [conversation, dispatch] = useReducer(s => s, 1);
  return null;
}
deno task build && deno task start

Find this error in the browser:

Cannot read properties of null (reading 'useReducer')

The issue seems to be that we're no longer importing something from aleph/react, I didn't dig further. As soon as something imports that module we're good again.

Initially I thought the issue was caused by removing _app.tsx, but I think it comes down to the same cause as described above.

@webpro webpro changed the title Removing _app.tsx breaks build Not importing aleph/react breaks the build Apr 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant