-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Issue building a simple example with Parcel #1509
Comments
Just guessing: This might be an issue because of wrong handling of paths/path-matching on windows as they usually get added unix-style to the browser field. ? |
I narrowed this down to dignifiedquire/lock-me. This gist is a minimal test case that demonstrates the above error. Adding |
The runtime parcel build error was a related issue with lock-me being required in the browser. lock-me is pulled in by js-ipfs-repo but it has been replaced with proper-lockfile in 0.25.1. In the latest version ipfs-repo specifies an in memory lock shim for the browser in the browser field of its package.json. So even though I thought this corroborated @mkg20001's hypothesis so I went on to create an even more minimal test case to prove/disprove parcel's browser shimming behaviour on windows:
This outputs 'i am the shim' and looking at the For completeness, I tried again with the browser shim specified in a package one level deeper I.E. A -> B -> C where package C specified the shim and ran parcel build again in package A. Parcel.js again did the right thing and included only the shim file. I'm confused, the browser shim behaviour should work as expected |
The bug in parcel on windows only show itself when the browser field is a relative path with more than one component. I.E.
I'll move this conversation to the parcel issue. |
@raoulmillais could you link us to the issue on the parcel repo? |
Sure thing @alanshaw it is the issue linked in the description |
There is a PR with a working (on unix) parceljs example with some further notes |
Now that #1726 exists, lets close this :) |
I tried to build the following example: https://gist.github.com/acailly/648d1a6e28c8939bbdf84499851c626d
(on Windows 10 64bits)
I have the following error:
It seems that browser field is not correctly handled by parcel (it tries to create a repo with node config instead of browser config).
I asked the question in parcel-bundler/parcel#1883 but the stange thing is that the same example works very well if we replace ipfs with another dependency that uses the browser field (like
on-load
, see https://gist.github.com/acailly/986047b786bf2dc247ea47bd2b0a1115)I failed to identify the root cause and have no clue.
I'm posting this here hopping that my simple reproducible use case will help in completing #1436
The text was updated successfully, but these errors were encountered: