Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Not importing aleph/react breaks the build #552

Description

@webpro

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions