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

Support Create React App V5 (with Webpack 5) #935

Closed
janpieterz opened this issue Aug 17, 2022 · 2 comments
Closed

Support Create React App V5 (with Webpack 5) #935

janpieterz opened this issue Aug 17, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@janpieterz
Copy link
Contributor

janpieterz commented Aug 17, 2022

Currently installing a new React app with Create React App fails.

@janpieterz
Copy link
Contributor Author

janpieterz commented Aug 17, 2022

I got this building locally by using the latest @craco/craco: 7.0.0-alpha.7, react-scripts: 5.0.1 and the below webpack.config.js. Webpack 5 has built-in support for WASM. Doesn't actually work yet though.

// craco.config.js
const { addBeforeLoader, loaderByName } = require("@craco/craco");

module.exports = {
  webpack: {
    configure: (webpackConfig) => {
      if (
        webpackConfig.experiments === undefined ||
        webpackConfig.experiments === null
      ) {
        webpackConfig.experiments = {};
      }
      webpackConfig.experiments.syncWebAssembly = true;
      webpackConfig.experiments.asyncWebAssembly = true;
      return webpackConfig;
    },
  },
};

I had to change the signIn logic (might be related to #940 ) from the below

service.signIn(new SignInRequest()).then((response) => {
    console.log(`auth_token = ${response}`);
  });

to

service.signIn().then((response) => {
    console.log(`auth_token = ${response}`);
  });

since SignInRequest is an interface. Showcase in Typescript playground

@janpieterz
Copy link
Contributor Author

@janpieterz janpieterz self-assigned this Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant