-
Notifications
You must be signed in to change notification settings - Fork 83
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
fflate.decompressSync is not a function when using nifti-reader-js
(React)
#193
Comments
This is most likely an issue with the bundler. Webpack's tree shaking has always been a bit suspicious - I'll look into what specifically is causing this. |
@101arrowz any updates? |
This will take me a few more weeks to get to, sorry for the delay! |
@101arrowz , thanks for looking into this and happy new year. |
@101arrowz Hi, any updates? Thanks! |
Looking into it now. This seems like a Webpack misconfiguration; the |
Yeah, this is an upstream bug with create-react-app. This can be fixed by using diff --git a/config-overrides.js b/config-overrides.js
new file mode 100644
index 0000000..7065965
--- /dev/null
+++ b/config-overrides.js
@@ -0,0 +1,11 @@
+module.exports = {
+ webpack: function (config, env) {
+ config.module.rules = config.module.rules.map(rule => {
+ if (rule.oneOf instanceof Array) {
+ rule.oneOf[rule.oneOf.length - 1].exclude = [/\.(js|mjs|jsx|cjs|ts|tsx)$/, /\.html$/, /\.json$/];
+ }
+ return rule;
+ });
+ return config;
+ },
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index 3861681..abfa3be 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "vanilla-basic",
"version": "1.0.0",
"scripts": {
- "dev": "react-scripts start",
+ "dev": "react-app-rewired start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
@@ -13,6 +13,7 @@
"@playwright/test": "^1.22.2",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
+ "react-app-rewired": "^2.2.1",
"typescript": "^4.0.5"
},
"description": "[Azure Static Web Apps](https://docs.microsoft.com/azure/static-web-apps/overview) allows you to easily build JavaScript apps in minutes. Use this repo with the [quickstart](https://docs.microsoft.com/azure/static-web-apps/getting-started?tabs=vanilla-javascript) to build and customize a new static site.", There seems to be an unrelated issue with SharedArrayBuffer not being defined due to missing COOP/COEP headers, but that can likely be fixed just by adjusting the Webpack config. Since this isn't a problem with |
How to reproduce
yarn install
yarn dev
package.json
dependencies areThe problem
We get an error because the fflate functions are not found
These are found when I am navigating my project, so it might have to do with the bundling...
The text was updated successfully, but these errors were encountered: