Open mischnic opened 3 years ago
hit the issue when using immer - it has pkg.source.
this causes a build failing, as __DEV__
was used in immer/src
while parcel did not have the var.
I'm not sure if this is related, but I'm working with Antd 4. One of the dependencies that gets pulled in is compute-scroll-into-view@1.0.16
The package.json
has the following...
{
"main": "dist/index.js",
"module": "dist/index.module.js",
"source": "src/index.ts"
}
However if I look at package structure, only the dist
directory exists. So I get the error...
@parcel/resolver-default: Could not load './src/index.ts' from module 'compute-scroll-into-view' found in package.json#source
This is where my ignorance shows. I don't know if the package was published wrong, the resolution order is wrong ("source"
shouldn't be evaluated before "main"
), or if the resolver should fallback and try a different property if say "source"
isn't found.
It's probably a package publishing problem, but I wanted to share in case there is an issue. If I remove the "source"
entry, everything compiles fine.
@baronnoraz -> https://github.com/parcel-bundler/parcel/issues/5784
🐛 bug report
When importing from a different package, the
package.json#source
field is applied. But if the imported package then imports itself again (by importing the folder containingpackage.json
,main
is used instead ofsource
.Probably a regression caused by https://github.com/parcel-bundler/parcel/pull/5508
🤔 Expected Behavior
Compiles successfully.
😯 Current Behavior
💻 Code Sample
monorepo where this package is imported:
https://github.com/mischnic/parcel-issue-5604
🌍 Your Environment