-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Parcel 2 gives wrong error message when node_modules contains types #6176
Comments
Not quite sure what you expected, if = to me, this is the same situation as #1655
That's a Parcel 1 plugin |
@mischnic my main concern with this issue is that the error message is outright wrong:
Lol. Well it was what I got when I googled for parcel flow plugin. Also
:( |
That error message actually comes from Babel (if you try to parse a Flow/TS file without the corresponding Babel plugins)
These are nothing special, they are used regularly in monorepos/workspaces where there are conflicting dependencies, meaning that some packages cannot be hoisted to the topmost node_modules folder.
|
But how can they come from babel if babel doesn't run on node_modules? If I open an issue at babel, what should I say?
Ah, I see. Yeah then the only easy fix is adjusting the error message to make it more clear. |
We do parse the code with Babel to then analyze
There's nothing the Babel team can do here. |
Ah, I see.
So it is a parcel issue after all? But I guess it's hard to know if babel throws that error because of something in node_modules… |
Not sure what to call this situation. We consider non-standard syntax in node_modules to be unsupported, because you should never ever publish that to npm. |
🐛 bug report
I'm compiling this: https://github.com/getsentry/sentry-javascript/tree/master/packages/browser/src to es2021 because sentry only ships es5 or es3 builds.
To not have to change every dependency in every file and not have to read and understand their build documentation I just symlinked all directories into node_modules.
Now my file structure looks like this:
But parcel's don't-transpile-node-modules somehow doesn't only recognize the node_modules containing parcel but also refuses to run the lazy_sentry node_modules through babel.
🎛 Configuration (.babelrc, package.json, cli command)
Standard parcel configuration with
@babel/preset-typescript
in the outer directory.node_modules
but no package.json in the inner one.🤔 Expected Behavior
Either that parcel just transpiles the code in the second node_modules or that it shows something like this:
😯 Current Behavior
I tried installing this: https://www.npmjs.com/package/parcel-plugin-flow but it didn't solve it
💁 Possible Solution
includes
in the file path check to something that only checks the node_modules in the root path of parcel🔦 Context
Was trying to build small sentry, actually it previously worked but in the last version they added that typescript.
💻 Code Sample
Ask me if there's interest in fixing and code sample is needed for that
🌍 Your Environment
The text was updated successfully, but these errors were encountered: