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
blocker: nuxt-ts fails to start application when package installed globally with npm #175
Comments
Is this bug reproducible when not using TypeScript and using ESM ( I never seen yet poeple packaging a nuxt app to use it as a dependency so I'll need time to debug correctly |
No, it's only in case of typescript. If I remove typescript syntax from file, it works. Working example with ESM and no typescript: const config = {
mode: 'universal',
buildModules: ['@nuxt/typescript-build']
}
export default config
We are not using nuxt-based app as dependency, we are building package with application itself and deploying it to production as globally installed npm package. I don't know how other people deploy it, but I don't know other ways to do it properly. This is the way many packages use to distribute, such as verdaccio, anyproxy, redis commander just to name a few.
Please let me know if I can do anything to help. Thanks for quick reply. |
@kevinmarrec important update: it breaks just if it lives inside directory named node_modules. Just create node_moduels anywhere, put nuxt_repro3 inside (with it's own deps ofc) and then try to start it, it will fail. Rename node_modules to mode_nodules and it will work. I suspect that this part are hardcoded somewhere. UPD: found a reason: https://github.com/TypeStrong/ts-node/blob/master/src/index.ts#L206 UPD2: https://github.com/TypeStrong/ts-node#how-it-works @kevinmarrec, should we add note to docs? |
As said earlier somewhere in another issue, we're working on making Nuxt production bundle TypeScript dependencies free, which will make what you want to achieve working without problems. The issue here it's just cause Pending work to track : #198 |
Describe the bug
Hello. We experienced very strange issue. Unfortunately, this is very serious roadblock for us, since we cannot deploy our nuxt application in production environment, so I think it's correct to consider it as blocker. If this way to deploy package are not correct, please give us some advices how it should be deployed, since we followed docs of nuxt/typescript when it happened.
Also I think that other people should be notified about presence of this bug in docs main page and readme, so they will not start using it in production until this resolved, because it can be a critical issue for business.
The story:
On production, we install our packages from private npm registry, including our nuxt apps. When we tried to install nuxt app and run it, it fails with the following error message:
It looks like nuxt trying to load nuxt.config.ts as js file, but fails. Executing npm run start in sources dir works well, but not for global installation of the package. Doesn't matter if installed via private registry or tarball, failure are the same. It tried using following:
npm: 6.12.0
node: v12.6.0
Tested in both windows 10 and latest debian.
Reproduction link (with detailed description): https://github.com/georgyfarniev/nuxt_repro3
To Reproduce
cd `npm config get prefix`/node_modules/nuxt_repro3
Expected behavior
Application starts correctly
Screenshots
N/A
Additional context
Might be probably related to #145, since it related to resolvers also.
UPD: Same issue happens when installed using yarn, and no matter if it installed globally or locally. So there is no way to run application after install via package :(
UPD2: It appears to be typescript-related issue, since just removing typescript keyword from nuxt.config.ts fixing this issue.
The text was updated successfully, but these errors were encountered: