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

Generated server package.json contains invalid version specification #19436

Closed
tobiasdiez opened this issue Mar 3, 2023 · 2 comments · Fixed by nitrojs/nitro#1013
Closed

Comments

@tobiasdiez
Copy link
Contributor

Environment

  • Operating System: Windows_NT
  • Node Version: v19.4.0
  • Nuxt Version: 3.1.1
  • Nitro Version: 2.1.0
  • Package Manager: yarn@3.3.0
  • Builder: vite
  • User Config: alias, nitro, ssr, app, css, modules, runtimeConfig, routeRules, tailwindcss, graphqlServer, content, naiveUI, vite
  • Runtime Modules: @nuxtjs/tailwindcss@6.4.1, @huntersofbook/naive-ui-nuxt@0.6.0, @pinia/nuxt@0.4.7, nuxt-graphql-server@1.1.5, nuxt-runtime-compiler@1.1.3, @nuxt/content@2.4.3, storybook-vue-addon/nuxt
  • Build Modules: -

Reproduction

No minimal reproduction yet, but here is a "big one": JabRef/JabRefOnline#1799

Describe the bug

Sometimes the generated package.json for the server contains invalid version specifier using | instead of || such as:

    "ufo": "1.1.1 | 1.0.1",
    "uuid": "8.3.2 | 9.0.0",

which then results in issues finding these modules:

Result: Failure Exception: Worker was unable to load function functions: 'Cannot find package 'ufo' imported from C:\home\site\wwwroot\functions\index.mjs' Stack: Error [ERR_MODULE_NOT_FOUND]: Worker was unable to load function functions: 'Cannot find package 'ufo' imported from C:\home\site\wwwroot\functions\index.mjs' at new NodeError (node:internal/errors:393:5) at packageResolve (node:internal/modules/esm/resolve:860:9) at moduleResolve (node:internal/modules/esm/resolve:909:20) at defaultResolve (node:internal/modules/esm/resolve:1124:11) at nextResolve (node:internal/modules/esm/loader:163:28) at ESMLoader.resolve (node:internal/modules/esm/loader:841:30) at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) at ModuleWrap. (node:internal/modules/esm/module_job:76:40) at link (node:internal/modules/esm/module_job:75:36)

Additional context

No response

Logs

No response

@pi0
Copy link
Member

pi0 commented Mar 3, 2023

What nitro preset gives worker error?

@tobiasdiez
Copy link
Contributor Author

In my case it occurs with azure (functions). I think I found the issue and solved it in nitrojs/nitro#1013.

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

Successfully merging a pull request may close this issue.

2 participants