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

Add dev dependency http-server for debugging ESM #8848

Merged
merged 2 commits into from
Feb 14, 2023

Conversation

jessetane
Copy link
Contributor

No description provided.

@Falke-Design
Copy link
Member

I have nearly no experience with ESM, can you please explain why this is needed?

Copy link
Collaborator

@jonkoops jonkoops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jessetane can you run npm install so the lockfile is also updated?

package.json Outdated Show resolved Hide resolved
@jonkoops
Copy link
Collaborator

I have nearly no experience with ESM, can you please explain why this is needed?

The CORS policy for scripts loaded with type=module is different. So unlike regular scripts they will not load from the file-ystem directly. For example, if I open up one of the recently converted files in the debug section I get the following error:

image

@Falke-Design
Copy link
Member

The CORS policy for scripts loaded with type=module is different. So unlike regular scripts they will not load from the file-ystem directly. For example, if I open up one of the recently converted files in the debug section I get the following error:

Ou ok thank you ... now i like it even less 😄

@jessetane
Copy link
Contributor Author

agree with you @Falke-Design that not being able to load modules directly from the filesystem is annoying... does anyone know why this limitation exists? i assume there is a good reason but it's not immediately obvious to me and it didn't jump out on a quick glance at the spec. see also: whatwg/html#8121. maybe this will change in the future?

@jessetane
Copy link
Contributor Author

more here whatwg/html#1888

@jessetane
Copy link
Contributor Author

the arguments there are pretty esoteric, not sure i can fully grasp them without more study but i guess i still prefer being forced to use an http server than non-standard build tools

@jonkoops
Copy link
Collaborator

It is what it is, having a HTTP server running is not the end of the world 😉

Copy link
Collaborator

@jonkoops jonkoops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jonkoops jonkoops merged commit 5a00ef3 into Leaflet:main Feb 14, 2023
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 this pull request may close these issues.

3 participants