Code Monkey home page Code Monkey logo

Comments (7)

iddriss avatar iddriss commented on August 16, 2024 1

Ended up using this

facebook/create-react-app#12700 (comment)

somehow the cjs file was still processed as a static file after building . Works perfectly on while using running the start script.

export default {
  webpack: {
    configure: config => ({
      ...config,
      module: {
        ...config.module,
        rules: config.module.rules.map(rule => {
          if (rule.oneOf instanceof Array) {
            // eslint-disable-next-line no-param-reassign
            rule.oneOf[rule.oneOf.length - 1].exclude = [
              /\.(js|mjs|jsx|cjs|ts|tsx)$/,
              /\.html$/,
              /\.json$/,
            ];
          }
          return rule;
        }),
      },
    }),
  },
};

from starknet-react.

fracek avatar fracek commented on August 16, 2024

It looks like something strange with get-starknet or get-starknet-core. Requires further investigation.

from starknet-react.

fracek avatar fracek commented on August 16, 2024

I tried to reproduce the issue with the following steps:

  • create a new project with npx create-starknet, selecting the next.js template
  • update the @starknet-react/core version to '^0.17.2'
  • run npm update
  • check that the lock file contains the updated version of starknet react
  • load the main page npm run dev and connect the wallet. The WalletBar component uses useConnectors so it should trigger this issue.

Unfortunately I did not get any error. Can you try to run the same steps as me and see if there is any issue?

from starknet-react.

iddriss avatar iddriss commented on August 16, 2024

Alright, I'll try that

from starknet-react.

fracek avatar fracek commented on August 16, 2024

Are you using create-react-app by any chance? In that case, it could be this issue facebook/create-react-app#12021

If you attach a debugger in the browser, you should see something like this (notice the .cjs extension)
2023-05-27-113234_649x347_scrot

from starknet-react.

fracek avatar fracek commented on August 16, 2024

I was able to fix the issue my monkey patching the webpack config used by cra. Here is the commit that shows exactly how to do it

from starknet-react.

iddriss avatar iddriss commented on August 16, 2024

I was able to fix the issue my monkey patching the webpack config used by cra. Here is the commit that shows exactly how to do it

This fixed my issue. Thanks for helping with the problem.

from starknet-react.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.