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
using @nuxt/typescript-build causes dead loop (npm only) #145
Comments
@georgyfarniev Couldn't reproduce it with your steps. So it means this is something to do with your |
@kevinmarrec you have to do npm install and npm run bootstrap only in root of repository, not in repro dir. It is enabling learna hoisting. Then go to repro dir and execute npm run dev. |
@kevinmarrec yes, it reproducible only in hoisted lerna monorepository. I will try yo downgrade nuxt and nuxt typescript tomorrow to find out where regression was introduced and I will try to pin point into change that causes it unless you do it before me. It’s night here, in Indonesia. Spent all day debugging it being sure it weird dependency collisions in our big monorepo, as it happened before with webpack, babel and similar stuff 😁 |
Couldn't make it work with nuxt (i.e. without TypeScript), sounds more likely a more globally bug, not TypeScript one. |
@georgyfarniev Please have a look at : |
I will double check my claim later, maybe I missed something out because my mind was messed up by end of the day after hardcore debugging session 😁. Thanks for Very quick reply to this issue. Strong,y appreciate it. P. S checking your link |
@kevinmarrec I cannot reproduce issue with plain js version of nuxt, and advice to update enhanced-resolve didn't worked for me. I pushed update into repo in issue description that demonstrates it. Please pull, delete all node_modules and do |
@georgyfarniev Indeed it works for reprojs but then I did :
And it works with TypeScript one |
Well it seems to be random OR I don't understand, probably something about The issue is that I don't really know how to debug it... |
@kevinmarrec i would try with older version of nuxt-ts and nuxt to see if it will fail also. Then do “binary search” strategy between two git revisions where it work and where it doesn’t work. |
@georgyfarniev Did it ever use to work with nuxt-ts ? |
@kevinmarrec it worked before. I forgot to mention that it broke up when we updated package-lock.json. Makes sense to downgrade nuxt-ts in provided example and see if it will work. Another approach is to simply find out how to get more verbose information from nuxt than it provides in image above. It’s question to nuxt developers probably. It’s definitely not a dependency collision, because monorepo in example has only one module inside. Probably something won’t getting resolved in hoisted setup. |
@kevinmarrec interesting fact, I did following:
But it only works if I also delete node_modules and delete @nuxt/typescript-build from package.json as well. Any ideas? UPD1: So removing @nuxt/typescript-build from packages fixes issue, but simple deleting it (rm -rf node_modules/@nuxt/typescript-build) doesn't help. What could that mean? Obviously, it's not @nuxt/typescript-build causes issue, but it's dependencies. So I coped it's dependencies to my package.json and bootstrapped with them and without @nuxt/typescript-build, and surprisingly, it worked for me. What a mystery! I triple checked it |
@kevinmarrec also it works fine in production mode, only dev server have this dead loop |
Using the repro steps I was able to see this issue. Here's a GIF of development, noting there are no errors in the console. @kevinmarrec Interested in hearing what debugging approaches might work best to tackle an issue like this given there are no errors. Should I set-up a debugging environment in an IDE and get a debugger in Node? |
@georgyfarniev Really weird, you can confirm that just removing the TypeScript module from May be related to @jhabdas Well, I succeeded to reproduce on my computer as well but looks like some magic random bug hard to debug x). I think it's something to do with |
But overall I'd say it's |
Yes. I tried to simply remove it from nuxt.config, but it has no effect, instead I have to even remove it from package.json and purge node_modules and reinstall (npm i && npm run bootstrap). I even modified installed module with console message to ensure that it aren't called, and I confirmed that this module has nothing to do in runtime.
Good idea, I will try it later. But we cannot use yarn instead of npm, because so many things will break up accidentally (tried). We have very big monorepo so far. I rather spend time to migrate on pnpm, but problem with webpack loaders resolution blocks me. Yes, npm dependencies is real hell and I spend a lot of time to fix related issues instead of being productive, because some people use a lot of small packages as left-pad or isobject. That's why we started to create something like standard library for NodeJS (WIP). Can you please try to investigate further to fix this bug? I will try to reproduce it with yarn and help you as much as possible. But you know internals much better than me and I have close deadline now :( |
Thanks for the infos
Well, if you have close deadline, consider asking your company (if it's a company project) to pay a Nuxt consulting (https://otechie.com/nuxt). It seems a bug that needs hours to debug and really specific to your company needs ( |
FYI: Even if I'm more likely the |
Still I'll try to dive into it again when I've some time, can't promise any fix soon, as I said it sounds really hard to debug :/ |
It might not be related with typescript, but related to module from this repository, that's why I submitted it here. |
By deadline I mean that I lack of time for investigation , not that it directly related to nuxt. But good to know about that service, thanks. I will try to investigate bug tomorrow morning,it makes me very curious after all. I will try to get more debug output from nuxt. I would like to understand why it happens. |
Update: trying to patch @nuxt/loading-screen in order to get more useful debug information. Will keep you updated about progress. |
I met this too. I use It works well on I've tried several days, waiting for your response. |
@georgyfarniev Nice, I still think it's even deeper and tied to nested dependency of |
@kevinmarrec it's enhanced-resolve. If I replace ts-loader with it, it broke build in same way. Keep going. |
nuxt/nuxt#6173 (comment) ^^ Dunno |
@kevinmarrec the most interesting thing is that I have same version of enhanced-resolve in both cases (with only nuxt dependency and with @nuxt/typescript-build). It’s latest version. I will try downgrading it. |
I said the same thing and was told I was incorrect. |
@ChrisKader, I apologize for telling that you was incorrect, because your solution doesn't work in our case, but our issue was caused by same module. Updating to latest enhanced-resolve doesn't help at all. And another weird fact: when I replace @nuxt/typescript-build with enhanced-resolve of latest stable version (4.1.1), it breaks build also. But when I install it from master it works, until I add @nuxt/typescript-build as dep :) See detailed examples here (each section represents dependencies): Works (enhanced-resolve removed one of it's deps (memory-fs) in this version, but should not be relevant, since it already presented): "enhanced-resolve": "webpack/enhanced-resolve#master",
"nuxt": "^2.10.1" Doesn't work (enhanced-resolve from github repo mixed with @nuxt/typescript-build): "@nuxt/typescript-build": "^0.3.2",
"enhanced-resolve": "webpack/enhanced-resolve#master",
"nuxt": "^2.10.1" Doesn't work (latest stable version): "enhanced-resolve": "^4.1.1",
"nuxt": "^2.10.1" Also, for second example, I just checked that version of enhanced-resolve that actually ends up in node_modules are same as in current master. e.g. 5.0.0-beta.3 |
Also works
|
As this issue is really high edge case and that this module is not responsible of any dependency resolution issue, this is unfortunately not something we can fix, sorry. Workarounds :
|
@kevinmarrec, but it doesn’t work even in unhoisted environments (without lerna). And it’s unclear how to solve it by specifying exact version. This is probably most typical use case for this module. Anyway, I fixed all my problems by migrating back to vue cli from nuxt and totally removing it from my project, especially because how such issues “resolved”. |
Hi, I made a simple repo. Can someone confirm this issue? |
Hi guys. However this (seems) was an issue with webpack-dev-middleware, i apologizes for this issue. Thanks to the works of @crutch12 and @simplesmiler this should be fixed with v2.13.2 ❤️ Keeping issue open until can confirm it is gone. |
Is there anyone that can confirm something has been indeed fixed around this ? |
I get this error:
I'm using a yarn workspace. The error occurs in the catch statement:
The variable {
configFile: '/workspace/project/tsconfig.json',
extensions: {
vue: true
}
} The following change makes the build succeed: - const typescriptPath = options.typescript || require.resolve('typescript');
+ const typescriptPath = require.resolve('typescript'); so this module seems to be passing an object when a string is expected. However, that seems to be because the version of fork-ts-checker-webpack-plugin that yarn decided to install was version 3, even though this project asks for v5 (it installs a separate package, fork-ts-checker-webpack-plugin-v5, that does not exist on npm). This is because I had a vue-cli app in another package, which uses v3. Adding |
I had the same problem as @lights0123 with yarn. |
I had the same issue (ERROR When you use this plugin you must install typescript). Was able to resolve it in
|
I'm still getting the same screen as OP. I'm on:
I'd love to help figuring this out. But I am not seeing any useful output anywhere. Nothing in the console. Nothing useful when running with If you can give me some pointers as to where to look for the root cause, I might be able to resolve this. Thanks. |
For people encountering @lights0123 issue on Yarn, I've fixed in the following way:
- "workspaces": [
- "packages/*"
- ],
+ "workspaces": {
+ "packages": ["packages/*"],
+ "nohoist": [
+ "**/fork-ts-checker-webpack-plugin",
+ "**/fork-ts-checker-webpack-plugin/**"
+ ]
+ },
|
I encountered this error and the fix for me was: Nothing above seemed to work. |
Describe the bug
When I run nuxt app using nuxt-ts in hoisted lerna monorepo, it causes weird behavior: when I open serve address, see 5 continuous reloads and this message:
To Reproduce
Steps to reproduce the behavior:
npm i && npm run bootstrap
cd repro && npm run dev
Expected behavior
Working correctly with hoisted lerna monorepo.
Additional context
Reproducible in both Windows 10 and Node 12, as well as Arch Linux with Node 12.
Please pay attention to lerna.json, as hoisted mode are enabled there.
Also, it's probably nuxt-ts issue, because everything works well with plain nuxt
This bug is a critical blocker for us, since we cannot use our applications written in nuxt+typescript using our lerna setup which is vital for us, so I will keep monitoring this issue and I'm ready to provide any possible assistance with fixing it.
The text was updated successfully, but these errors were encountered: