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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parcel output refers to a nonexistent js file, when referring to other html file #2791
Comments
Same problem with Parcel |
I'm having the exact same issue in my project with Parcel I've noticed that this only happens when running In the meantime, downgrading to Parcel 1.9.7 appears to work for me. |
Newer versions incorrectly link html files: parcel-bundler/parcel#2791
|
Newer versions incorrectly link html files: parcel-bundler/parcel#2791
Newer versions incorrectly link html files: parcel-bundler/parcel#2791
|
Confirm bug:
creates a html with non existent js:
while
creates html with wrong (relative) path
Fixing the path by hand to
works |
Choose one: This is a 馃悰 bug report
Inside my index.html I have an anchor href that refers to other html in other folder. For some reason Parcel output includes a script tag to a js file that cannot be found. Of course, the browser fails to load the generated page because of that.
馃帥 Configuration (.babelrc, package.json, cli command)
index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Home Page</title>
</head>
<body>
I agree to all the <a href="docs/terms.html" target="_blank">terms of use</a>
</body>
</html>
docs/terms.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<title>Terms of Use</title>
</head>
<body style="background-color: yellow">
Terms of Use:
</body>
</html>
CLI command
parcel index.html
馃 Expected Behavior
Valid output of index.html, that referes correctly to docs/terms.html
馃槸 Current Behavior
In the generated index.html file, the header looks like this:
<head>
聽
<meta charset="utf-8">
聽
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
聽
<title>Home Page</title>
聽
<script src="/terms.js"></script>
Invalid location!</head>
the output includes also docs folder with terms.html and terms.js, that contains Parcel code. However the script src above is invalid, and the page fails to load in the browser because of that.
馃拋 Possible Solution
Refer correctly to the generated js file.
馃敠 Context
Testing Parcel for building static site.
馃捇 Code Sample
Provided above.
馃實 Your Environment
The text was updated successfully, but these errors were encountered: