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

Webpack declares alias of "itkConfig.js" but is not referenced. #822

Closed
YeonHoJeong opened this issue May 4, 2023 · 5 comments
Closed

Comments

@YeonHoJeong
Copy link

YeonHoJeong commented May 4, 2023

Hello !

I'm trying to use itk-wasm, but I found that ServiceWorker is not being created.

I suspect that the reason I identified is that the webpack alias of itkConfig.js I declared is not reflected.

In createWebWorkerPromise.js, the config is treated as undefined and returns an error.

Is there any data to refer to or possible cause in this regard?

Thank you.

@thewtex
Copy link
Member

thewtex commented May 4, 2023

Hello!

In recent versions of itk-wasm WebPack alias for itkConfig.js is not required. Instead, it is better to use setPipelinesBaseUrl and setPipelineWorkerUrl.

@YeonHoJeong
Copy link
Author

@thewtex

Thanks for your solution !

Then, do I have to call all other settings (imageIO, meshIO ...) by method like "pipelineWorkerUrl"?

And is there a separate page that provides information about these initial configuration settings?

@thewtex
Copy link
Member

thewtex commented May 8, 2023

Then, do I have to call all other settings (imageIO, meshIO ...) by method like "pipelineWorkerUrl"?

Currently these are still overridden by itkConfig.js, but they will not need to be set separately from pipelinesBaseUrl.

And is there a separate page that provides information about these initial configuration settings?

The documentation will be updated after image-io, mesh-io migration is complete. To summarize for each package (image-io and mesh-io are migrating to their own package per #716 ), the configuration setting will be:

  1. getPipelinesBaseUrl on the package if defined
  2. getPipelinesBaseUrl on the itk-wasm package if defined.
  3. JsDeliver CDN hosting of the wasm modules by default.

@YeonHoJeong
Copy link
Author

YeonHoJeong commented May 8, 2023

I will refer to it when updating the latest version of itk-wasm.

First of all, there seems to be a conflict in my current project environment, so if I fix it, I will write the cause.

Thank you !

@YeonHoJeong
Copy link
Author

I found a solution to my problem.

In my project, I excluded node_modules in the "babel-loader" setting.

Accordingly, I changed itkConfig.js to common.js form.

In addition, the '@babel/plugin-transform-modules-commonjs' plugin was setup to have the process of transform the ESM to common.js.

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