Skip to content
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

Add support for Angular v13.3.3 #247

Closed
wants to merge 6 commits into from

Conversation

ovitrif
Copy link
Contributor

@ovitrif ovitrif commented Apr 20, 2022

Closes #234

  • Add support for Angular 13*.

To test:

  • Clone locally (gh pr checkout 247)
  • Run npm install
  • Run npm run test:once
  • Run npm run build:demo

@ovitrif ovitrif changed the title Support Angular v13.3.3 Add support for Angular v13.3.3 Apr 20, 2022
@ovitrif
Copy link
Contributor Author

ovitrif commented Apr 20, 2022

I don't know what's going on but for me I can't get npm run test:once neither npm run build:demo green.

I get the following errors:

npm run build:demo

./src/demo/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Transform failed with 1 error:
/Users/ovitrif/repos/github/ncstate-sat/popover/src/demo/app/focus/focus.component.scss:17:100: ERROR: Unterminated string token
    at /Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/@ngtools/webpack/src/ivy/loader.js:81:18
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

./src/demo/polyfills.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: Transform failed with 1 error:
/Users/ovitrif/repos/github/ncstate-sat/popover/src/demo/app/focus/focus.component.scss:17:100: ERROR: Unterminated string token
    at /Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/@ngtools/webpack/src/ivy/loader.js:81:18
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

./src/demo/styles.scss.webpack[javascript/auto]!=!./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].rules[0].oneOf[0].use[1]!./node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].rules[0].oneOf[0].use[2]!./node_modules/resolve-url-loader/index.js??ruleSet[1].rules[5].rules[1].use[0]!./node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].rules[1].use[1]!./src/demo/styles.scss - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.

1 │ @use '~@angular/material' as mat;
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  src/demo/styles.scss 1:1  root stylesheet

./src/demo/styles.scss - Error: Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
HookWebpackError: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.

1 │ @use '~@angular/material/_index.scss' as mat;
  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  src/demo/styles.scss 1:1  root stylesheet
    at tryRunOrWebpackError (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/HookWebpackError.js:88:9)
    at __webpack_require_module__ (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/Compilation.js:5049:12)
    at __webpack_require__ (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/Compilation.js:5006:18)
    at /Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/Compilation.js:5077:20
    at symbolIterator (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/neo-async/async.js:3485:9)
    at done (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/neo-async/async.js:3527:9)
    at Hook.eval [as callAsync] (eval at create (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/tapable/lib/Hook.js:18:14)
    at /Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/Compilation.js:4984:43
    at symbolIterator (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/neo-async/async.js:3482:9)
-- inner error --
Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.
  
1  @use '~@angular/material/_index.scss' as mat;
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  src/demo/styles.scss 1:1  root stylesheet
    at Object.<anonymous> (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].rules[0].oneOf[0].use[1]!/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].rules[0].oneOf[0].use[2]!/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/resolve-url-loader/index.js??ruleSet[1].rules[5].rules[1].use[0]!/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].rules[1].use[1]!/Users/ovitrif/repos/github/ncstate-sat/popover/src/demo/styles.scss:1:7)
    at /Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/javascript/JavascriptModulesPlugin.js:441:11
    at Hook.eval [as call] (eval at create (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:7:1)
    at Hook.CALL_DELEGATE [as _call] (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/tapable/lib/Hook.js:14:14)
    at /Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/Compilation.js:5051:39
    at tryRunOrWebpackError (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/HookWebpackError.js:83:7)
    at __webpack_require_module__ (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/Compilation.js:5049:12)
    at __webpack_require__ (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/Compilation.js:5006:18)
    at /Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/webpack/lib/Compilation.js:5077:20
    at symbolIterator (/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/neo-async/async.js:3485:9)

Generated code for /Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[5].rules[0].oneOf[0].use[1]!/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[5].rules[0].oneOf[0].use[2]!/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/resolve-url-loader/index.js??ruleSet[1].rules[5].rules[1].use[0]!/Users/ovitrif/repos/github/ncstate-sat/popover/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[5].rules[1].use[1]!/Users/ovitrif/repos/github/ncstate-sat/popover/src/demo/styles.scss
1 | throw new Error("Module build failed (from ./node_modules/sass-loader/dist/cjs.js):\nSassError: Can't find stylesheet to import.\n  ╷\n1 │ @use '~@angular/material/_index.scss' as mat;\n  │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  ╵\n  src/demo/styles.scss 1:1  root stylesheet");

npm run test:once

./src/lib/popover/popover.component.scss?ngResource - Error: Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Can't find stylesheet to import.

1 │ @use '~@angular/cdk' as cdk;
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  src/lib/popover/popover.component.scss 1:1  root stylesheet

I would really appreciate it if one of the maintainers helps me debug this.

@isaackehle
Copy link
Member

Since that's me, I'll take a look.

@ovitrif
Copy link
Contributor Author

ovitrif commented Apr 20, 2022

Since that's me, I'll take a look.

Thank you @isaackehle! 🙇

I also don't remember exactly why I changed the ng-packagr version so please feel free to suggest if I should revert it 👍

FYI, my npm & node versions are latest lts:

  • 📦 v8.0.2
  • ⬢ v16.14.2

If there's any requirement for the node version we could add a .nvmrc file 👍

@amansachdev
Copy link

Hi @ovitrif @isaackehle,
When can I expect this PR to get merged with the master branch.
so that I can use this updated dependency in my angular 13 project .
Can you give me some estimate please.
Actually my project I am trying to migrate it to angular 13 from angular 12 and this dependency I am using won't allow me to.
Please let me know when can I expect this.
Thank you.

@ovitrif
Copy link
Contributor Author

ovitrif commented May 6, 2022

When can I expect this PR to get merged with the master branch.
Hi @amansachdev, thanks for the ping 🙇

I really hope @isaackehle will have time to look into it, it's not in my hands at the moment so we need at least a review before I can know if there is something else to do for it.

At the moment I noticed I have to merge this with master again so I can do that but we still need the review by one of the maintainers.

Meanwhile what you can do (what I did myself) is:

  1. Clone my repo locally
  2. Switch to the branch of this PR which is angular-13.3.0
  3. Run npm install to install package from file system
    like this:
    npm i --save ../location-of-your-packages-root-directory
  4. Verify that in the package.json of your project (the one you want to migrate to Android 13), you have a dependency declared similarly to what I have:
"@ncstate/sat-popover": "file:../../../github/ncstate-sat/popover/dist/popover",

For me it works and I was able to fully migrate my project that depends on this package to Angular 13.

@isaackehle
Copy link
Member

Released https://github.com/ncstate-sat/popover/releases/tag/v9.0.0

@ovitrif
Copy link
Contributor Author

ovitrif commented May 9, 2022

Released https://github.com/ncstate-sat/popover/releases/tag/v9.0.0

Thanks a lot for taking care of this @isaackehle 🙇‍♂️!

@ovitrif ovitrif deleted the angular-13.3.0 branch May 9, 2022 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Angular v13
4 participants