store icon indicating copy to clipboard operation
store copied to clipboard

Library version 1.7.1 crashes Aurelia CLI Bundler builds

Open LukevanTricht opened this issue 4 years ago • 4 comments

I'm submitting a bug report

  • Library Version: 1.7.1

Please tell us about your environment:

  • Operating System: WSL (Ubuntu)

  • Node Version: v16.14.0

  • NPM Version: 8.3.1

  • JSPM OR Webpack AND Version Aurelia-CLI v2.0.3

  • Browser: Chrome 99

  • Language: TypeScript 4.6.2

Current behavior: After upgrading from 1.7.0 to 1.7.1, my build now crashes with the following error:

./node_modules/aurelia-store/dist/aurelia-store.d.ts(1,33): error TS2307: Cannot find module '@redux-devtools/extension' or its corresponding type declarations.
./node_modules/aurelia-store/dist/aurelia-store.d.ts(64,46): error TS2307: Cannot find module '@redux-devtools/extension' or its corresponding type declarations.

Expected/desired behavior: Hopefully, a patch update like this shouldn't have killed the build process. Replication Steps(Can provide a minimal project as a repo if you'd like):

  1. Create a new AU project, as a custom project with Typescript, the Aurelia CLI as a bundler, and yarn
  2. yarn add aurelia-store
  3. Import any aurelia-store object(I chose connectTo)
  4. yarn build

LukevanTricht avatar Mar 16 '22 06:03 LukevanTricht

meh, sry about that. It seems I've added the typings fir the extension as devDependency instead of prod.

meanwhile please npm i -d @redux-devtools/extension yourself to avoid that build issue

zewa666 avatar Mar 16 '22 10:03 zewa666

@LukevanTricht v1.7.2 has been released and should address this issue. Please take a look and see whether it works for you

zewa666 avatar Mar 16 '22 12:03 zewa666

@zewa666 It looks like you're missing a dependency that @redux-devtools requires, I got this warning doing the upgrade:

warning "aurelia-store > @redux-devtools/[email protected]" has unmet peer dependency "redux@^3.1.0 || ^4.0.0".

And my build failed with:

/node_modules/@redux-devtools/extension/lib/types/developmentOnly.d.ts(1,31): error TS2307: Cannot find module 'redux' or its corresponding type declarations.
/node_modules/@redux-devtools/extension/lib/types/index.d.ts(1,54): error TS2307: Cannot find module 'redux' or its corresponding type declarations.
/node_modules/@redux-devtools/extension/lib/types/logOnly.d.ts(1,31): error TS2307: Cannot find module 'redux' or its corresponding type declarations.
/node_modules/@redux-devtools/extension/lib/types/logOnlyInProduction.d.ts(1,31): error TS2307: Cannot find module 'redux' or its corresponding type declarations.

LukevanTricht avatar Mar 16 '22 19:03 LukevanTricht

that's super weird, as I've tested it out with a fresh new CLI project without any troubles. Although I must admit it was Webpack now that I think. Anyways, seems they're having the same type of issue I had of using a devDependency as prod :(

I'm definitely not interested in adding Redux as a dependency as that goes way too far just for the sake of typings. The offending line is here. I'm not sure whether a type-only import would perhaps remove the issue or whether this is something specific to the CLI bundler. @3cp any ideas?

EDIT: meh ... it's a peerDependency ... grrmpf. I really would have liked to use the upstream for proper typings but under this light it really starts to make no sense. I guess I'll have to copy/paste the EnhancerOptions type to the aurelia-store repo itself in order to avoid this mammoth of dependency hell

zewa666 avatar Mar 16 '22 20:03 zewa666