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

Chunks are loaded from /static #141

Closed
ferretwithaberet opened this issue Jul 21, 2022 · 7 comments
Closed

Chunks are loaded from /static #141

ferretwithaberet opened this issue Jul 21, 2022 · 7 comments

Comments

@ferretwithaberet
Copy link

I am using React.lazy to benefit from code-splitting, but the app tries to load the chunks from /static(Example http://localhost:8080/static/js/498.e475ad48.chunk.js the correct one being http://localhost:8080/resources/diqsw/login/keycloak-themes-react/build/static/js/498.e475ad48.chunk.js).

I created the app using yarn create react-app then added keycloakify and @emotion/react. The app works fine if I start it with yarn start.

@garronej
Copy link
Collaborator

Hi @ferretwithaberet,

Please produce a minimal repo that reproduce the issue ans I'll look into it.

@garronej
Copy link
Collaborator

And please make sure you are using the latest version of Keycloakify

@ferretwithaberet
Copy link
Author

Please produce a minimal repo that reproduce the issue ans I'll look into it.

There you go.

garronej added a commit that referenced this issue Jul 22, 2022
@garronej
Copy link
Collaborator

garronej commented Jul 22, 2022

I wrote the tests, now I need to implement.

@garronej
Copy link
Collaborator

I have done an implementation but it's so uneficient that any app would take ages to build.
Need to refactor.

garronej added a commit that referenced this issue Jul 28, 2022
@garronej
Copy link
Collaborator

It's done 🥳
Thanks for reporting I'll be able to use to levrage React.lazy() for improving perfomances for thoses not using --external-assets!

garronej added a commit that referenced this issue Jul 29, 2022
garronej added a commit that referenced this issue Aug 5, 2022
@AlexandrValerevich
Copy link

Faced with same issue but in little bit another form.

If I build the same code several times one .jar file work well and use /resources/{id}/static/... path for fetching recourses (expected behavior) and sometime it change path to static/... and get failed.

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

3 participants