Tech Debt: Masa React can't be used from within next.js
H34D opened this issue · comments
Sebastian commented
On building a next js app that includes masa-react it gives me:
yarn dev
yarn run v1.22.19
warning package.json: "test" is also the name of a node core module
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
warning package.json: "test" is also the name of a node core module
(node:56026) [DEP_WEBPACK_MODULE_ISSUER] DeprecationWarning: Module.issuer: Use new ModuleGraph API
(Use `node --trace-deprecation ...` to show where the warning was created)
error - ./node_modules/@masa-finance/masa-react/dist/src/components/modal/styles.scss
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/@masa-finance/masa-react/dist/src/components/modal/modal.js
Import trace for requested module:
./node_modules/@masa-finance/masa-react/dist/src/components/modal/styles.scss
./node_modules/@masa-finance/masa-react/dist/src/components/modal/modal.js
./node_modules/@masa-finance/masa-react/dist/src/components/modal/index.js
./node_modules/@masa-finance/masa-react/dist/src/components/index.js
./node_modules/@masa-finance/masa-react/dist/src/index.js
wait - compiling...
error - ./node_modules/@masa-finance/masa-react/dist/src/components/modal/styles.scss
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/@masa-finance/masa-react/dist/src/components/modal/modal.js
Import trace for requested module:
./node_modules/@masa-finance/masa-react/dist/src/components/modal/styles.scss
./node_modules/@masa-finance/masa-react/dist/src/components/modal/modal.js
./node_modules/@masa-finance/masa-react/dist/src/components/modal/index.js
./node_modules/@masa-finance/masa-react/dist/src/components/index.js
./node_modules/@masa-finance/masa-react/dist/src/index.js
Sebastian commented
i created an example repo: https://github.com/H34D/masa-react-next
simo d. commented
Part of webpack refactor
Sebastian commented