-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Module build failed: TypeError: loaderUtils.getOptions is not a function #595
Comments
I think we'd need a repro to understand this. |
I just had this problem too. In my case, it was caused by an older version of the You could manually add a more recent version of |
@creativecoder I tried updating to the latest version, but I am still getting the same error. |
@psujit Can you confirm that in your project you have If runtime is complaining |
any progress on this? |
Just saw that error. Was because I had an older version of |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing as stale. Please reopen if you'd like to work on this further. |
I'm getting "loaderContext.getOptions is not a function" now in ts-loader 9.0.2 with webpack 4.44, typescript 4.2.3, and loader-utils 2.0.0. I just upgraded to hopefully fix a different set of problems, so I have no real working configuration to go back to or compare. I'm wondering if my timing is coincidental with some breaking change. |
ts-loader 9 doesn't support webpack 4: https://github.com/TypeStrong/ts-loader/releases/tag/v9.0.0 |
i am getting same error, now what is the work around? |
If you're still using Webpack 4, or Node <12, try using |
@marquizzo thanks, as i my latest storybook lib already have webpack 4.46.0, i had to remove webpack of higher version from package.json, and then with webpack 4 ,ts-loader 8.2.0 is compatible version.these changes solved my problem. |
I was running into cryptic build errors that seemed related to old versions of dev dependencies, specifically this one for an old version of webpack (two major versions behind): TypeStrong/ts-loader#595 (comment) I upgraded webpack and ran into another strange error so I opted to upgrade all dev dependencies (they are only dev dependencies after all and as long as it builds and tests properly we should be good).
I'm getting this error with what I believe are correct versions for webpack 5 with workspaces in Npm@7 I've gotten the error to intermittently go away... Not sure how. Might have been a different error with higher priority too.
UpdateSomething in the top level npm workspace was installing webpack 4 and |
This is exactly what happened to me. I have a create-react-app in one package and trying to use webpack 5 and webpack-cli in other-package. Webpack 4 was installed in the root node_modules, and Webpack 5 was installed in the other package's node_modules
|
I think this happens a lot. I'm tempted to add a warning to the console (or even a hard error) to say "you're not using webpack 5 - you need to". |
Webpack does print the version that is currently being run. It just easily gets lost in all the other stuff that webpack prints! IMHO, a guard that has a more clear error would not be unwelcome. |
|
@johnnyreilly This is the generally accepted best practice for error handling. It would be nice to have at least one library in the js world that follows best practices) |
The same error with the same tool set: ts-loader@9.2.6 with webpack@5.67.0 and happypack@5.0.1 |
You may encounter this problem using GULP. I updated webpack-stream to version 7.0 and it solved the problem. Maybe this will help someone |
Syntax Error: TypeError: loaderContext.getOptions is not a function @ multi (webpack)-dev-server/client?http://192.168.43.215:8080&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.ts I am currently encountering this challenge when migrating vue2 to vue3 with typescript, does anyone have an insight on this, kindly assist. |
@patrickikhidero did u somehow managed to solve it since i'm encountering the same problem for hours.. |
@albizeka You should post more details about your setup. Migrating from vue2 to vue3 alone should not affect TypeScript or Webpack, unless you're using some prefab tool that makes changes to dependencies for you. Did you try the solution in this answer above? #595 (comment) |
same for me |
I am trying to import a TS project in my JS project using ts-loader, but I am getting the following error. What can be the issue in this case?
The text was updated successfully, but these errors were encountered: