When I run yarn start I get:
Failed to compile.
./.yarn/cache/jss-plugin-rule-value-function-npm-10.1.1-f63c97f8af-2.zip/node_modules/jss-plugin-rule-value-function/dist/jss-plugin-rule-value-function.esm.js
Module not found: jss-plugin-rule-value-function tried to access tiny-warning, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Steps:
<Button>Test</Button> to App.tsx (with import Button from '@material-ui/core/Button';)I'm trying to use yarn2 to get that sweet zero-Installs feature.
OS: NixOS unstable
| Tech | Version |
| ----------- | ------- |
| Material-UI | v4.9.12 |
| React | 16.13.1 |
| Browser | Firefox |
| TypeScript | 3.7.2 |
| yarn | 2.0.0-rc.32 |
tsconfig.json
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react"
},
"include": [
"src"
]
}
@bbigras Please open the issue in JSS, It's an issue on their end. Also, I would be in favor of dropping the dependency on tiny-warning.
Requires the release of https://github.com/cssinjs/jss/pull/1315
I am getting a similar issue on v4.9.12 when react and react-dom are added as a peer dependency in my app (moving them to a normal dependency made the issue disappear):
./.yarn/$$virtual/@material-ui-core-virtual-613969f2c4/0/cache/@material-ui-core-npm-4.9.12-eaaa062c1e-2.zip/node_modules/@material-ui/core/Modal/TrapFocus.js
Module not found: @material-ui/core tried to access react (a peer dependency) but it isn't provided by its ancestors; this makes the require call ambiguous and unsound.
I am getting a similar issue on v4.9.12 when react and react-dom are added as a peer dependency in my app (moving them to a normal dependency made the issue disappear):
peer dependencies of a library need to be added as normal dependencies in your app. This is unrelated to this issue.
If you want to be notified when this issue is fixed watch https://github.com/cssinjs/jss for releases (click "watch" and then "releases only"). More specifically, watch for the next release of jss-plugin-rule-value-function.
JSS v10.2.0 was released, problem solved.
Most helpful comment
Requires the release of https://github.com/cssinjs/jss/pull/1315