Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Multiple pages with Parcel #243

Closed
zjhch123 opened this issue Dec 13, 2017 · 7 comments
Closed

🐛 Multiple pages with Parcel #243

zjhch123 opened this issue Dec 13, 2017 · 7 comments

Comments

@zjhch123
Copy link

zjhch123 commented Dec 13, 2017

🐛 bug report

I was trying out if it was possible to use multiple pages with Parcel

Configuration - only these 5 files

<!-- 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')
  }
}

Command

parcel index.html

😯 Current Behavior

First Question

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'.

Second Question

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

🤔 Expected Behavior

First

the page1 and page2's <a> should have correct attr

Second

this Exception shouldn't be thrown and 'hi' should be printed

💁 Possible Solution

First Question

I don't know about this..

Second Question

I guess that may be caused by those two files(index.js, index2.js) import the same file(util.js)

🌍 Your Environment

Software Version(s)
Parcel Latest on master
Node v8.9.0
npm/Yarn yarn 1.2.1
Operating System macOS 10.13
@DeMoorJasper DeMoorJasper changed the title Multiple pages with Parcel #bug Multiple pages with Parcel Dec 13, 2017
@DeMoorJasper DeMoorJasper changed the title Multiple pages with Parcel 🐛 Multiple pages with Parcel Dec 13, 2017
@DeMoorJasper
Copy link
Member

Tested on Mac OS X High Sierra 10.13.2 and can confirm this doesn't work

@ssuman
Copy link
Contributor

ssuman commented Dec 13, 2017

I'm working on this.

real34 added a commit to real34/tmp-hugo-parcel-playground that referenced this issue Dec 15, 2017
@davidnagli
Copy link
Contributor

Is this a duplicate of #189?

@DeMoorJasper
Copy link
Member

This is not related to #189 @davidnagli

@davidnagli
Copy link
Contributor

Whoops ok I guess I just didn’t understand the issue, they just looked kinda similar.

@mikekok
Copy link

mikekok commented Dec 21, 2017

I'm currently facing the exact same issue as well.

@devongovett
Copy link
Member

This should be fixed by #380.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants