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

Webpack build with typescript fails on the route.ts file #1071

Open
ArtemK123 opened this issue May 2, 2021 · 0 comments
Open

Webpack build with typescript fails on the route.ts file #1071

ArtemK123 opened this issue May 2, 2021 · 0 comments

Comments

@ArtemK123
Copy link

Package(s)

  • router

Describe the bug
I have tried to use your lib in my project, but it causes the build to fail. I am using Webpack5 with typescript, and during the build, the ts-loader plugin from Webpack fails because of invalid type casts in the route.ts file from your lib.

The error is following:

ERROR in D:\Developing\PolytechWebThings\src\Web\ClientApp\node_modules\@profiscience\knockout-contrib-router\src\route.ts
161:4-55
[tsl] ERROR in D:\Developing\PolytechWebThings\src\Web\ClientApp\node_modules\@profiscience\knockout-contrib-router\src\route.ts(161,5)
  TS2322: Type 'RouteConfig' is not assignable to type 'NativeRouteConfig[]'.
  Type 'string' is not assignable to type 'NativeRouteConfig[]'.
ts-loader-default_e3b0c44298fc1c14 

To Reproduce
Url to my project - > https://github.com/ArtemK123/PolytechWebThings

  1. Clone my repo
  2. Go to "/src/Web/ClientApp"
  3. Install the latest version of the router lib (2.1.5 at the moment of writing): npm install @profiscience/knockout-contrib-router
  4. Try to add an import in some .ts file. I have used index.ts for this. Add the following import there import { Route, Router } from '@profiscience/knockout-contrib-router';
  5. Run webpack build via npm run build

Expected behavior
Webpack build is finished successfully

Desktop (please complete the following information):

  • Windows 20H2
  • node v12.17.0
  • The build was executed from the cmd
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

No branches or pull requests

1 participant