馃悰 bug report
I was trying out if it was possible to use multiple pages with Parcel
<!-- First page -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<a href="./index2.html">goto page2</a>
<script type="text/javascript" src="./index.js"></script>
</body>
</html>
// index.js
import util from './util'
util.hi()
<!-- Second Page -->
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<a href="./index.html">goto page1</a>
<script type="text/javascript" src="./index2.js"></script>
</body>
</html>
// index2.js
import util from './util.js'
util.hi()
// util.js
export default {
hi() {
console.log('hi')
}
}
parcel index.html
The first page(index.html) can link to second page(index2.html), but in the second page, the tag <a> doesn't have the correct attr 'href'.
In the first page(index.html), I catch this Exception
Uncaught Error: Cannot find module '14'
at newRequire (test-parcel.js:32)
at localRequire (test-parcel.js:38)
at Object.require.7../util (test-parcel.js:71)
at newRequire (test-parcel.js:46)
at require.7../util (test-parcel.js:63)
at test-parcel.js:68
the page1 and page2's <a> should have correct attr
this Exception shouldn't be thrown and 'hi' should be printed
I don't know about this..
I guess that may be caused by those two files(index.js, index2.js) import the same file(util.js)
| Software | Version(s)
| ---------------- | ----------
| Parcel | Latest on master
| Node | v8.9.0
| npm/Yarn | yarn 1.2.1
| Operating System | macOS 10.13
Tested on Mac OS X High Sierra 10.13.2 and can confirm this doesn't work
I'm working on this.
Is this a duplicate of #189?
This is not related to #189 @davidnagli
Whoops ok I guess I just didn鈥檛 understand the issue, they just looked kinda similar.
I'm currently facing the exact same issue as well.
This should be fixed by #380.
Most helpful comment
I'm working on this.