Skip to content

Getting error: You may need an additional loader #20471

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

Closed
csname1910 opened this issue Apr 8, 2021 · 3 comments
Closed

Getting error: You may need an additional loader #20471

csname1910 opened this issue Apr 8, 2021 · 3 comments

Comments

@csname1910
Copy link

I am getting the following error.

You can reproduce it with this minimal GitHub repository:

https://github.com/csname1910/errordemo

Error: ./node_modules/pdfjs-dist/build/pdf.js 2413:45
Module parse failed: Unexpected token (2413:45)
File was processed with these loaders:
 * ./node_modules/@angular-devkit/build-angular/src/babel/webpack-loader.js
 * ./node_modules/@ngtools/webpack/src/ivy/index.js
You may need an additional loader to handle the result of these loaders.
|         intent: renderingIntent,
|         renderInteractiveForms: renderInteractiveForms === true,
>         annotationStorage: annotationStorage?.getAll() || null
|       });
|     }
@JoostK JoostK transferred this issue from angular/angular Apr 8, 2021
@JoostK
Copy link
Member

JoostK commented Apr 8, 2021

Heya, the optional chaining syntax is not supported by Webpack 4, see webpack/webpack#10227, and that is used in the Angular CLI. Support for Webpack 5 is currently experimental in Angular CLI 11.

@alan-agius4
Copy link
Collaborator

Indeed as @JoostK mentioned the optional chaining is not support by Webpack 4 which is used in the Angular CLI 11, to opt-in using experimental support for Webpack 5 which is not recommended to be used for production. See: #18820.

In version 12, the Angular CLI will use Webpack 5 which does support the mentioned syntax see: #20466

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants