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

Doesn't serve source maps correctly #98

Open
lazarljubenovic opened this issue Jun 20, 2023 · 0 comments
Open

Doesn't serve source maps correctly #98

lazarljubenovic opened this issue Jun 20, 2023 · 0 comments

Comments

@lazarljubenovic
Copy link

My HTML (generated by the official HTML plugin):

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Rollup Bundle</title>
    
  </head>
  <body>
    <script src="main.js" type="module"></script>
  </body>
</html>

My main.js:

const x = 1;
console.log(x + 2);
//# sourceMappingURL=main.js.map

The contents of the file main.js.map, which sits right next to the main.js file:

{"version":3,"file":"main.js","sources":["../src/main.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA,MAAM,CAAC,GAAW,CAAC,CAAA;AACnB,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC"}

When I serve such a folder "normally" (e.g. using python3 -m http.server, everything works correctly. The original main.ts file is available through Chrome's developer tool.

But when I use this plugin to serve the folder, the source maps are inaccessible. Chrome somehow recognizes the directory structure, as you can see from the first image; however, the contents of this file are not getting fetched, as shown on the second image.

image

image

The error message reads the following.

Could not load content for http://localhost:10001/src/main.ts (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant