nuxt / bridge

🌉 Experience Nuxt 3 features on existing Nuxt 2 projects
MIT License
273 stars 29 forks source link

Cannot find package '/usr/src/app/.output/server/node_modules/ufo #345

Closed rvmourik closed 2 years ago

rvmourik commented 2 years ago

Environment


Reproduction

.

Describe the bug

If I run the nuxi preview command after building it, it produces the following error:

 Cannot find package '.output/server/node_modules/ufo/'

I saw this issue nuxt/nuxt.js#13818 with the same message but this is for Nuxt 3 and I am using Bridge for this project. I have deleted the .output/.nuxt/node_modules/yarn.lock and installed everything from scratch to see if that resolves the problem. Sadly it doesn't.

As @pi0 asked in the related issue if the .output/server/node_modules directory exists, it does and there is also a folder with the name ufo with an index.cjs en index.mjs in it. However, the package.json is missing in the folder. Could that be the problem the import doesn't work.

Also if I inspect the ./server/index.mjs in Webstorm, Webstorm can't open the import 'ufo' line, but it can open the others like import 'unstorage'.

Hope you can help me out with this.

Additional context

No response

Logs

No response

HomWang commented 2 years ago

Maybe you can use https://codesandbox.io

P4sca1 commented 2 years ago

Related (including a reproduction): https://github.com/nuxt/bridge/issues/344

Luferov commented 2 years ago

And if added “ufo” to transpile?

rvmourik commented 2 years ago

And if added “ufo” to transpile?

nope, that doesn't work. But I guess the missing package.json in the ufo folder is the issue.

dargmuesli commented 2 years ago

I guess a merge of https://github.com/nuxt/nuxt.js/pull/10013 could help, which upgrade ufo to 0.8.4.

rvmourik commented 2 years ago

I guess a merge of nuxt/nuxt.js#10013 could help, which upgrade ufo to 0.8.4.

I manually added it to a resolves in package.json and installed 0.8.4, for now that causes the error to be gone.

gustawdaniel commented 2 years ago

This can be connected:

https://github.com/nuxt/nuxt.js/issues/13956

I prepared PR that updates only ufo but need a maintainer to approve running workflows:

https://github.com/nuxt/nuxt.js/pull/10503

P4sca1 commented 2 years ago

After upgrading my dependencies by refreshing the lock file, this issue is gone for me. Can you confirm?

dargmuesli commented 2 years ago

I can confirm. @danielroe do your thing 😜❌