masa-finance / masa-react

Masa React Framework

Home Page:https://masa.finance

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tech Debt: Masa React can't be used from within next.js

H34D opened this issue · comments

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

Part of webpack refactor

image

i still have an issue here

i think its caused by:

import * as buffer from 'buffer';
window.Buffer = buffer.Buffer;
export * from './components';
export * from './helpers';
export * from './provider';