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

Source Maps Have Incorrect Path and Won't Display in Browser #45

Closed
homestar9 opened this issue Jan 28, 2023 · 4 comments
Closed

Source Maps Have Incorrect Path and Won't Display in Browser #45

homestar9 opened this issue Jan 28, 2023 · 4 comments

Comments

@homestar9
Copy link
Contributor

It looks like source maps aren't being created properly in Elixir V4 which causes them to not be recognized in the browser.
Here's how to replicate the issue:
In commandbox:
coldbox create app skeleton=elixir
In Terminal (CMD)
npm i
npm run prod
In Commandbox
server start

When the browser opens, you will see the following message in the console:
DevTools failed to load source map: Could not load content for http://127.0.0.1:54854/includes/css/includes\css\App.321689fbd5b7dc45da8d.css.map: HTTP error: status code 500, net::ERR_HTTP_RESPONSE_CODE_FAILURE

If you open the /includes/css/App.321689fbd5b7dc45da8d.css file you will see the comment at the very bottom reads:
/*# sourceMappingURL=includes\css\App.321689fbd5b7dc45da8d.css.map*/
It should be:
/*# sourceMappingURL=App.321689fbd5b7dc45da8d.css.map */
The path should be omitted since the map is in the same directory as the css file and there should be an extra space after .map

Additionally, the map file has the following key:
"file":"includes\\css\\App.321689fbd5b7dc45da8d.css"
It should be:
"file":"App.321689fbd5b7dc45da8d.css"

@jclausen
Copy link
Collaborator

I will take a look at this. I have not seen this error in any of the sites I use Elixir v4 on

@homestar9
Copy link
Contributor Author

I'm not sure if this is related or not, but Elixir 4 converts SCSS relative paths like this:
url( "../../img/logo.png" );
to this:
url(/includes/images/logo.png);
Note the path is no longer relative to the scss file and instead relative to what it thinks is the root. However, if the asset is needed in a submodule, the link will break in the Webpack-processed version.

I have a feeling in my gut the two issues may be connected somehow.

@homestar9
Copy link
Contributor Author

Summarized in #47

jclausen added a commit that referenced this issue Feb 22, 2023
@jclausen
Copy link
Collaborator

This should be resolved in v4.0.4

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

2 participants