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 map url improperly encoded for dynamic routes #88

Closed
FallingSnow opened this issue Jan 14, 2021 · 3 comments · Fixed by #95
Closed

Source map url improperly encoded for dynamic routes #88

FallingSnow opened this issue Jan 14, 2021 · 3 comments · Fixed by #95

Comments

@FallingSnow
Copy link
Contributor

When loading a dynamic route, the source map that attempts to be loaded is already url encoded.
Screenshot from 2021-01-13 16-26-04

404 - http://localhost:8080/_aleph/pages/pipeline/view/%5Bname%5D.js.map
200 - http://localhost:8080/_aleph/pages/pipeline/view/[name].js.map

@FallingSnow
Copy link
Contributor Author

FallingSnow commented Jan 21, 2021

This can be resolved by moving decodeURI from

const filePath = path.join(project.appRoot, 'public', decodeURI(pathname))

to
const pathname = util.cleanPath(url.pathname)

to read

const pathname = util.cleanPath(decodeURI(url.pathname))

@ije
Copy link
Member

ije commented Jan 21, 2021

thanks @FallingSnow , can you please make a PR? or I will fix this in swc branch.

FallingSnow added a commit to FallingSnow/aleph.js that referenced this issue Jan 21, 2021
@FallingSnow
Copy link
Contributor Author

Pull: #95

@shadowtime2000 shadowtime2000 linked a pull request Jan 21, 2021 that will close this issue
shadowtime2000 added a commit that referenced this issue Jan 22, 2021
fix: Decode server.ts URLs global (#88)
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

Successfully merging a pull request may close this issue.

2 participants