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

build(webpack): set the publicPath to an empty string #475

Closed
wants to merge 1 commit into from

Conversation

bnmajor
Copy link
Collaborator

@bnmajor bnmajor commented Apr 25, 2022

Automatic publicPath is not always supported.

Automatic publicPath is not always supported.
Copy link
Collaborator

@PaulHax PaulHax left a comment

Choose a reason for hiding this comment

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

A step in the right direction!

Regarding the test 404: Looks like the default, publicPath: 'auto' resolves to an absolute path which helps out pipeline.worker.js

@bnmajor
Copy link
Collaborator Author

bnmajor commented Apr 25, 2022

@PaulHax Thanks! If you have some insight here I'd love it since my experience with Webpack is limited and I'm basically going through a lot of Google and guess and check at this point...

I need to add itk-vtk-viewer as a dependency for tensorboard-plugin-3d, but when I do I get an error: Automatic publicPath is not supported in this browser. Local testing shows that setting the publicPath to an empty string (generally the first suggestion I am seeing when digging around) does work for me in the plugin, but this is creating test failures (as you can see).

Running the tests myself I see that it fails in imjoyTest.js trying to call setImage with a URL. When the publicPath is not set to auto it returns a 404 trying to fetch NrrdImageIOReadImage.wasm. It should be using the path /base/dist/itk/image-io/NrrdImageIOReadImage.wasm but instead it is looking for /base/dist/itk/web-workers/min-bundles/itk/image-io/NrrdImageIOReadImage.wasm.

@PaulHax
Copy link
Collaborator

PaulHax commented Apr 25, 2022

I'm been flaying at this same thing too =(

Not sure this is the proper approach but lifting pipeline.worker.js up passes the tests =)

https://github.com/Kitware/itk-vtk-viewer/compare/master...PaulHax:public-path-hax?expand=1

@bnmajor
Copy link
Collaborator Author

bnmajor commented Jul 21, 2022

This PR is outdated and not needed, closing.

@bnmajor bnmajor closed this Jul 21, 2022
@bnmajor bnmajor deleted the public-path branch July 21, 2022 14:00
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.

None yet

2 participants