Parcel: style= causes bogus js files to be referenced

Created on 6 Oct 2018  ยท  4Comments  ยท  Source: parcel-bundler/parcel

๐Ÿ› bug report

adding style= can cause non-hashed named js files to be included that dont exist

๐ŸŽ› Configuration (.babelrc, package.json, cli command)

no babel, no package.json.. cli is parcel one.html

๐Ÿค” Expected Behavior

This works fine if i have no style=

๐Ÿ˜ฏ Current Behavior

I see the dist/one.html adding a "two.js" include -- that file does not exist so i get a browser and hmr issue.

๐Ÿ’ป Code Sample

$ cat one.html
<span style='font-size: 1em;'></span>
<a href='two.html'>link</a>

$ cat two.html
<span style='font-size: 1em;'></span>

$ parcel one.html
Server running at http://localhost:1234
โœจ  Built in 687ms.
^C

$ cat dist/one.html
<script src="/two.js"></script><span style="font-size: 1em;"></span>
<a href="/two.html">link</a>

$ ls dist
one.html        one.js          one.map         two.html

see that <script src="/two.js"> ? what is that from?

the crazy part is that if i remove style= from the html files, the problem goes away.

$ parcel -V
1.10.1
Bug Stale

Most helpful comment

Then why is that file not generated? It totally messes up the hmr by not being there. I'd like the hmr to work, but it doesn't because the file is missing.

All 4 comments

That's the hmr code for page refreshes...

If it really annoys you use --no-hmr

It shouldn't be there in production

Then why is that file not generated? It totally messes up the hmr by not being there. I'd like the hmr to work, but it doesn't because the file is missing.

Ow now I see, the original issue description looked more like a confusion about why the file was there rather than it was missing...

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oliger picture oliger  ยท  3Comments

donaldallen picture donaldallen  ยท  3Comments

philipodev picture philipodev  ยท  3Comments

adamreisnz picture adamreisnz  ยท  3Comments

Niggler picture Niggler  ยท  3Comments