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

fresh.gen.ts is not found #2440

Open
xXACCEXx opened this issue May 21, 2024 · 7 comments
Open

fresh.gen.ts is not found #2440

xXACCEXx opened this issue May 21, 2024 · 7 comments

Comments

@xXACCEXx
Copy link

I've been migrating an existing project to WSL Ubuntu installation.

First port of call, generating a new fresh project, moving in components/islands/routes/static etc etc.
Second port of call, run deno task build to make sure all the deps and such are all setup.

The issue is; it caches modules, then thorws this error.

error: Uncaught (in promise) TypeError: not found
  const manifest = (await import(toFileUrl(join(dir, "fresh.gen.ts")).href))

My project dir.

me@mine /home/me/project $ ls -la
drwxr-xr-x 10 me me 4096 May 20 11:41 ./
drwxr-xr-x  3 me me 4096 May 20 11:02 ../
-rw-r--r--  1 me me  179 May 20 11:02 .gitignore
drwxr-xr-x  2 me me 4096 May 20 11:02 .vscode/
-rw-r--r--  1 me me  363 May 20 11:02 README.md
drwxr-xr-x  2 me me 4096 May 20 11:08 components/
-rw-r--r--  1 me me 1464 May 20 11:49 deno.jsonc
-rwxrwxrwx  1 me me  233 May 20 11:33 dev.ts*
-rw-r--r--  1 me me 2880 May 20 11:36 dev_command.ts
-rw-r--r--  1 me me  160 May 20 11:02 fresh.config.ts
-rwxr--r--  1 me me 1989 May 20 11:49 fresh.gen.ts*
drwxr-xr-x  2 me me 4096 May 20 11:08 islands/
-rw-r--r--  1 me me  364 May 20 11:02 main.ts
drwxr-xr-x  4 me me 4096 May 20 11:11 routes/
drwxr-xr-x  4 me me 4096 May 20 11:13 static/
-rw-r--r--  1 me me  148 May 20 11:02 tailwind.config.ts

My system deets.

  • fresh 1.6.8
  • deno 1.43.5 (release, x86_64-unknown-linux-gnu)
  • v8 12.4.254.13
  • typescript 5.4.5
  • Ubuntu 20.04 - WSL 2 - Windows 10 (inside the ubuntu fs)

The obvious question I have about running deno --verison is the x86_64-unknown-linux-gnu bit.
I would think that would know at least debian or something.

What I've tried.

  • I've tried running the file directly with deno run. same error.
  • I've tried importing from a REPL session. Same error.
  • I've tried importing frm a throw away module. Same error.
  • I've tried deno cache -r and manually deleting cache, then rerunning. Same error.
@marvinhagemeister
Copy link
Collaborator

I wasn't able to reproduce this with the following steps in WSL:

  1. Run deno run -Ar https://fresh.deno.dev
  2. Run cd fresh project
  3. Run deno task start

Maybe I'm missing a step?

@xXACCEXx
Copy link
Author

Yea, when starting a new project, things work fine, until I move in components/islands etc from the original project.
What I'll do is try the migrating more slowly, until something triggers the error.

I'll report my findings once I'm done.

My gut tells me its probably a file/folder permissions thing in the new file system. But I'll know more when I get through some slow asf migration steps.

@xXACCEXx
Copy link
Author

xXACCEXx commented May 21, 2024

Ok. So I've finally got through the annoying task of migrating by hand. And I was able to reproduce 2 nasty side effects of Deno in WSL.

The first is actually a bug in the Deno VSCode plugin. Types for the package 'npm:contentful' and 'npm:@contentful/rich-text-types' do not work. That is its own issue, and probably related to how they package their code... I'll explore that seperately.

The second issue is the one I originally saw. Again, a package is throwing an error and causing issues, but the build step in fresh reports this as unhandled promise rejection. The package in question is 'active-campaign-react' And I'm unsure of what the real issue underlying this is. I'll do some more research tomorrow.

Uncaught (in promise) TypeError: not found
  const manifest = (await import(toFileUrl(join(dir, "fresh.gen.ts")).href))
                    ^
    at async dev (https://deno.land/x/[email protected]/src/dev/dev_command.ts:38:21)
    at async file:///home/me/projects/fresh-drumline/dev.ts:8:1

@xXACCEXx
Copy link
Author

Ok, I'm now absolutely sure the issue here is with that specific module.

A couple things here.

  1. There was a bug in deno 1.43.5 that was fixed in deno 1.43.6 that did not load @types properly.
  2. Module imports that fail are not explained properly when not found. ie: the module that failed is not named in the error.

that second note is worth fixing I think.

@ThomasDeutsch
Copy link

i run into the same issue.
I try to use the open layers library.

I added the library in the deno.json imports
"ol": "npm:ol@latest"

And i get the error when i try to import from a sub-directory of that module ( in my case the ol module )

import { Map as olMap, View } from 'ol';  // THIS IS OK
import TileLayer from 'ol/layer';  // ERROR

@kemicofa
Copy link

I'm encountering the same issue. Very confusing bug.

@kemicofa
Copy link

The culprit ended up being npm:crypto library. Just opted to use a npm:uuid and things started working again.

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

No branches or pull requests

4 participants