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

dev.zenroom.org: Zenroom in react is outdated (Medium is updated) #589

Closed
andrea-dintino opened this issue Jan 25, 2023 · 1 comment · Fixed by #972
Closed

dev.zenroom.org: Zenroom in react is outdated (Medium is updated) #589

andrea-dintino opened this issue Jan 25, 2023 · 1 comment · Fixed by #972
Assignees
Labels
documentation issue related to documentation

Comments

@andrea-dintino
Copy link
Member

@andrea-dintino andrea-dintino added the documentation issue related to documentation label Jan 25, 2023
@andrea-dintino andrea-dintino self-assigned this Jan 25, 2023
@matteo-cristino
Copy link
Collaborator

matteo-cristino commented Jan 27, 2023

Since the new release of react-scripts version 5 the javascript documentation is outdated and does not work anymore. The v5 excludes support for some node features and polyfills that were available in lower versions, i manage to overcome this first issue by installing (inside the freshly created app) react-app-rewired with the command:

yarn add react-app-rewired

followed by the the installation of all needed packages:

yarn add browserify-fs crypto-browserify path-browserify stream-browserify buffer zenroom

To use this new package creates config-overrides.js in the main root and copy inside it the following code:

module.exports = function override (config, env) {
    console.log('override')
    let loaders = config.resolve
    loaders.fallback = {
        "fs": require.resolve("browserify-fs"),
        "path": require.resolve("path-browserify"),
        "stream": require.resolve("stream-browserify"),
        "crypto": require.resolve("crypto-browserify"),
        "buffer": require.resolve("buffer")
    }
    return config
}

and inside package.json modify start from react-scripts start to react-app-rewired start. In this way it starts with no error, but it raise a warning sayng:

WARNING in ./node_modules/zenroom/dist/module/index.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/matteo/src/zenroom-react-test/node_modules/zenroom/src/index.ts' file: Error: ENOENT: no such file or directory, open '/home/matteo/src/zenroom-react-test/node_modules/zenroom/src/index.ts'

And the browser page will be white without printing the {"hello": "world"}, i have no clue on how to solve the last issue 😖

@matteo-cristino matteo-cristino linked a pull request Nov 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation issue related to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants