Missing server build import files: Cannot find module '#gql/default' or its corresponding type declarations
See original GitHub issueEnvironment
- Operating System:
Linux
- Node Version:
v16.18.1
- Nuxt Version:
3.0.0
- Nitro Version:
1.0.0
- Package Manager:
yarn@1.22.19
- Builder:
vite
- User Config:
alias
,experimental
,build
,app
,sourcemap
,dir
,typescript
,modules
,vite
,runtimeConfig
- Runtime Modules:
()
,@pinia/nuxt@0.4.3
,nuxt-graphql-client@0.2.12
,@vueuse/nuxt@9.5.0
- Build Modules:
-
Describe the bug
I’ve upgraded to Nuxt v3 stable and latest version of lib and updated all imports to #gql. Now it can’t build
Works fine in nuxt dev, fails in nuxt build
Expected behaviour
Project builds
Reproduction
No response
Additional context
runtimeConfig: {
public: {
'graphql-client': {
codegen: {
onlyOperationTypes: false,
},
},
},
},
Logs
ℹ Client built in 11342ms
ℹ Building server...
✔ Server built in 8706ms
✔ Generated public .output/public
ℹ Building Nitro Server (preset: node-server)
src/components/views/catalog/CatalogCardPresentation.vue(27,28): error TS2307: Cannot find module '#gql/default' or its corresponding type declarations.
Issue Analytics
- State:
- Created 10 months ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Typescript: import fail: Cannot find module 'query.gql' #59
Try adding type declaration DocumentNode from graphql typings. // index.d.ts import { DocumentNode } from 'graphql' ...
Read more >Cannot find module 'react' or its corresponding type ...
The editor throws errors while importing every installed library like this: Cannot find module 'react' or its corresponding type declarations. The project ...
Read more >How to import my own module from a test file? - Reddit
I'm working on a node package but can't seem to figure out how to import said package ... or its corresponding type declarations.ts...
Read more >Fix Global Installs Not Working | "Cannot find module" error FIX
Getting " Cannot find module " after installing something globally (with -g)? Well, this video shows you how to fix global package/module ...
Read more >aguscha333 - RedwoodJS Community
Hi, I got to the deployment point of the blog tutorial and I am trying to deploy to Netlify with a mysql db...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@daniluk4000 Perfect! Though It’s strange that the sub alias for
#gql
isn’t added in the production build, I may have to add it explicitly to prevent others from encountering this.Thank You! Happy to see that you’ve been enjoying this module. Much more great features are on the way.
@daniluk4000 Apologies for the late reply here, I’ve attempted to recreate this locally to no avail. Would you be willing to create a basic reproduction of this issue or give me access to the private repo for this project? I’d like to have a closer look to pinpoint the cause here