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

BREAKING CHANGE: webpack < 5 used to include polyfills for node.js - Ionic/Cordova #1

Open
Guirdin opened this issue Jul 20, 2023 · 1 comment

Comments

@Guirdin
Copy link

Guirdin commented Jul 20, 2023

Hello,
I can't get @techstark/opencv-js package to integrate into my Ionic/Cordova project. I get the following error:

Error

openjsTechnstarkIssue

package.json

image

webpack.config.js

image

folders

image

Tests

I've tried stuff found on the forums like creating a config folder with the “webpack.config.js” in it, but it's not being read.
I moved the file to the root of the project, it doesn't work either.
I moved to “src” and it doesn't work either…

I went to see “https://github.com/TechStark/opencv-js/issues/10” but it's a React project.
I'm under angular, so I don't have a “node-modules\react-scripts\” directory, and I can't find an equivalent.

Having a “polyfills.ts” file, I tried to use it with something I found on forums:
image

But again no results…

@Wabinab
Copy link

Wabinab commented Sep 1, 2023

You could probably try this:

Add to package.json in root level:

"browser": {
    "fs": false,
    "path": false,
    "crypto": false
  }

Source: https://stackoverflow.com/questions/57161839/module-not-found-error-cant-resolve-fs-error-solved

I haven't tried if it compiles in mobile. But on ionic v7 it compiles in the browser.

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