question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Package path ./dist/styles.css is not exported from package

See original GitHub issue

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

Angular

Which UI component?

Authenticator

How is your app built?

pretty default angular 15 setup

What browsers are you seeing the problem on?

Chrome

Please describe your bug.

I have migrated my working angular 14 app to angular 15. I don’t exactly know what causes the problem but it has never happened before the upgrade but is happening now - it might, however, also be related to the recent changes in this library.

When I try to build the application I get the following errors:

./node_modules/@angular-devkit/build-angular/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[6].rules[0].oneOf[0].use[1]!./node_modules/@angular-devkit/build-angular/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[6].rules[0].oneOf[0].use[2]!./node_modules/@aws-amplify/ui-angular/theme.css - Error: Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/css-loader/dist/cjs.js):
Error: Package path ./dist/styles.css is not exported from package ###/node_modules/@aws-amplify/ui-angular/node_modules/@aws-amplify/ui (see exports field in ###/node_modules/@aws-amplify/ui-angular/node_modules/@aws-amplify/ui/package.json)

./src/styles.scss?ngGlobalStyle - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/@angular-devkit/build-angular/node_modules/css-loader/dist/cjs.js):
Error: Package path ./dist/styles.css is not exported from package ###/node_modules/@aws-amplify/ui-angular/node_modules/@aws-amplify/ui (see exports field in ###/node_modules/@aws-amplify/ui-angular/node_modules/@aws-amplify/ui/package.json)

I assume that the export statement in packages/ui/package.json line 12 is the mistake, because the name is “./styles.css” instead of “./dist/styles.css”. I’m not sure if the export without dist is required, so my proposed solution is adding the line ".dist/styles.css": "./dist/styles.css", which for me fixes the problem. I will create a PR with this change.

What’s the expected behaviour?

Should build.

Help us reproduce the bug!

I think it should be enough to simply use Amplify UI in the newly released angular 15.

Code Snippet

No response

Additional information and screenshots

No response

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
SilverLinings89commented, Nov 16, 2022

The proposed changes is included in the pr 3001: https://github.com/aws-amplify/amplify-ui/pull/3001

2reactions
wlee221commented, Nov 24, 2022

Quick update, we merged your PR, and this patch will be released next Tuesday. Thanks for your patience! We’ll close this issue after release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can not import widgets.css file not exported from package.json
Build/Cesium/Widgets/widgets.css is not exported from package E:\MyResearch\CesiumJsGIS\node_modules\cesium (see exports fiel
Read more >
how to export and import style in npm package? - Stack Overflow
1 Answer 1 · 3. For webpack, do npm install --save-dev css-loader . Then in your webpack.config.js, add this line to the use...
Read more >
auroralabs - Laracasts
Hi, Im trying to import some Swiper 7 modules into a projct and when i hit mix the following exception is thrown Module...
Read more >
MiniCssExtractPlugin - webpack
Disclaimer: MiniCssExtractPlugin is a third-party package maintained by ... or import styles in the initial chunk, mini-css-extract-plugin will not load ...
Read more >
global css cannot be imported from within node_modules.
Hi, I am trying to use shareon within a Webpack project, but I cannot import the styles, I get an error: Package path...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found