Open Alamantus opened 2 years ago
I haven't checked the output yet but this sounds very similar to https://github.com/parcel-bundler/parcel/issues/7101
@mischnic
I haven't checked the output yet but this sounds very similar to #7101
That's what I had found before I submitted the issue, but I was able to build my project without an error so it seemed worth a new submission (though it's worth mentioning that adding not ios_saf < 13
to the browserlist as suggested in recent comments was necessary to get it to build). But it does sounds like a similar (if not the same) cause!
I'm not using Parcel for this project anymore, but I will say that it's irritating seeing so many issues marked as stale or auto-closed across GitHub just because time has passed. Just because nobody has commented on something doesn't mean the problem has magically gone away, and these GitHub actions that pretend like they're not bugs anymore drive me insane.
🐛 bug report
When I run
parcel build
on my project (at last commit using parcel) and open the resulting html file in a browser, the rendered file returns a duplicated but mangledglobal
view nested within theglobal
view instead of the target view.Using
parcel serve
does not produce this error, so there must be something going wrong with the build process.🎛 Configuration (.babelrc, package.json, cli command)
package.json
.parcelrc
🤔 Expected Behavior
It should display the html of the target view nested within the global view:
😯 Current Behavior
It is re-rendering the global view nested within itself, but with inconsistently mangled text and link errors:
💁 Possible Solution
Not sure what's causing the problem, but it looks like whatever minification process is being used is storing the value returned by
views/global.js
and re-using it everywhere thehtml
template literal tag is being used?Disabling my custom transformers did not change the result for me, so I don't think they are related.
🔦 Context
I'm trying to produce a single HTML file with the transpiled JS inside of a
script
tag. It works correctly when usingnpm start
but not when I usenpm run build
. I also have annpm test
script that starts a node server in case the browser doesn't like running HTML files from the file system.💻 Code Sample
https://github.com/Alamantus/FeatherWiki (last commit using parcel)
To reproduce:
npm install
npm start
& visit localhost:1234 to see how it's supposed to behavenpm test
& visit localhost:3000 to see what's going wrong🌍 Your Environment
Also occurs in MacOS and when using either Firefox or Chromium.