-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
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
Cannot find module "react-popper" on alternate compilations during watch mode when using typescript and node 10 #11266
Comments
Do you have a reproduction example? |
|
I found the issue, |
I updated the description and the reproduction for typescript as this only seems to affect typescript projects. |
I have tried our TypeScript example with node v10.0.0. I have no issue. Can you try that out? https://github.com/mui-org/material-ui/tree/v1-beta/examples/create-react-app-with-typescript |
I am using |
@arjanfrans Thanks for the feedback :) |
@oliviertassinari No problem. Why did you close the issue? |
@arjanfrans It confirms that that issue isn't coming from Material-UI, |
I have this issue as well with |
I have the same issue with Material-UI 1.0.0 and |
If it helps to debug this issue, I created a sample repo with the problem in this issue. If not |
None, unless you have a paid support contract! 😆 (But the beauty of open source is you get to find and fix bugs, which in turn helps others.) |
@go2ready 's workaround of removing |
You have to remove everything that depends on typings (even unused symbol detection) from your tslint and it should go away. |
@ohjames Thanks for the idea, but I don't use tslint and I still have a similar problem. |
Seems not material-ui problem, but popper itself. Has the same behaviour when using only popper package and CRA with custom tslint rules. Removing "no-unused-variable": [true, "react"], rule from tslint .json solves the problem. |
I encountered the same issue :S Strange.. I haven't been able to solve it using @go2ready's solution. |
Getting the same error on a fresh project using CRA Typescript https://github.com/wmonk/create-react-app-typescript, happens when the compiler watch recompiles. |
I believe I had the same error. I was using absolute import paths and had |
I can confirm that removing |
Same issue :/ @jmarceli's workaround worked though. |
It's a bit of a shame as we used to have lint rules in our project that automatically removed all unused imports, but they rely on the option you have to remove to get this to work. Does anyone have any idea where the blame is here? i.e. does react-popper work outside of this project? |
@ohjames The only difference now is that unused variables and imports will now fail the build rather than warn as a linting issue. |
@liangchunn I know but that won't let me |
@ohjames In that case, you might want to use a pre-commit hook that lints your project with an extended version of {
"extends": "./tslint.json",
"rules": {
"no-unused-variables": true
}
} This would still fail the build during compile time, but at least unused imports that hasn't gone though the build will be automatically fixed before being pushed upstream. |
ok, so on a new CRA project this has been biting me in the ass as well. it's constantly "indefinite-observable". @oliviertassinari stated that indefinite-observable isn't a MUI dependency which is correct, and thus the issue is not related, but i've traced it back to being a dependency of JSS, which is a direct dependency of MUI. So, long story short, a direct dependency of MUI has a dependency on indefinite-observable, so ergo importing material-ui into a create-react-app-typescript project causes this failure. I'm off to try and see what the hell is going on and bring the issue up in the JSS issue tracker. EDIT: removed incorrect info; version numbers were different. EDIT2: chased this further to a TSLint bug. will proceed to investigate and discuss there. suggest leaving this comment here as a breadcrumb as this is the page that shows up when googling the problem. EDIT2: super, super edit. the root cause of this issue stems from use of the rule |
Similar to this bug: #11197
Only the issue happens with react-popper 0.10.4, and material-ui versions beta-41 through the latest (beta-45).
When I'm using
react-scripts start
viayarn start
the error in the title shows up on every other recompilation. I change a file, I get the error. I change another file, I don't get the error. I change a file, I get the error. Forever.The problem manifests when using node 10 but not node 9. I tried
yarn 2.5
andyarn 2.6
but the problem is the same. Not sure aboutnpm
.The text was updated successfully, but these errors were encountered: