Found the problem. The import_map.json file was empty.
import_map.json
{ "imports": {} }
Should be:
{ "imports": { "~/": "./", "aleph/": "https://deno.land/x/aleph@v0.3.0-alpha.24/", "framework": "https://deno.land/x/aleph@v0.3.0-alpha.24/framework/core/mod.ts", "framework/react": "https://deno.land/x/aleph@v0.3.0-alpha.24/framework/react/mod.ts", "react": "https://esm.sh/react@17.0.2", "react-dom": "https://esm.sh/react-dom@17.0.2" }, "scopes": {} }
In case anyone else runs into this.
Thanks! I had the same problem.
Now I have another one when running aleph build:
aleph build
ERROR module '/pages/components/logo.tsx' not found ERROR module '/pages/lib/useCounter.ts' not found
No idea why.
Ok, fixed by changing the import paths.
First, I tried changing the import map's first entry to this but didn't work:
"~/": "../",
Then I changed the import path themselves and it worked!
import Logo from '../components/logo.tsx' import useCounter from '../lib/useCounter.ts'
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Found the problem. The
import_map.json
file was empty.Should be:
In case anyone else runs into this.
Thanks! I had the same problem.
Now I have another one when running
aleph build
:No idea why.
Ok, fixed by changing the import paths.
First, I tried changing the import map's first entry to this but didn't work:
Then I changed the import path themselves and it worked!