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.

Regression: PagedJS broken in beta.20

See original GitHub issue

Describe the bug

Starting with beta.20 I can’t import { Previewer } from "pagedjs" anymore (pagedjs is a npm module). It works until beta.19. After beta.20 vite fails with the following error:

[plugin:vite:import-analysis] Failed to resolve entry for package "pagedjs". The package may have incorrect main/module/exports specified in its package.json.
/***/print/index.ts
Error: Failed to resolve entry for package "pagedjs". The package may have incorrect main/module/exports specified in its package.json.
    at resolvePackageEntry (C:\***\node_modules\vite\dist\node\chunks\dep-3d0f2228.js:40062:15)
    at tryNodeResolve (C:\***\node_modules\vite\dist\node\chunks\dep-3d0f2228.js:39920:11)
    at Context.resolveId (C:\***\node_modules\vite\dist\node\chunks\dep-3d0f2228.js:39831:28)
    at Object.resolveId (C:\***\node_modules\vite\dist\node\chunks\dep-3d0f2228.js:52711:53)
    at processTicksAndRejections (node:internal/process/task_queues:93:5)
    at async TransformContext.resolve (C:\***\node_modules\vite\dist\node\chunks\dep-3d0f2228.js:52495:23)
    at async normalizeUrl (C:\***\node_modules\vite\dist\node\chunks\dep-3d0f2228.js:45852:34)
    at async TransformContext.transform (C:\***\node_modules\vite\dist\node\chunks\dep-3d0f2228.js:45965:57)
    at async Object.transform (C:\***\node_modules\vite\dist\node\chunks\dep-3d0f2228.js:52775:30)
    at async transformRequest (C:\***\node_modules\vite\dist\node\chunks\dep-3d0f2228.js:590

System Info

  • vite version: 2.0.0-beta.21
  • Operating System: win 10
  • Node version: 15
  • Package manager (npm/yarn/pnpm) and version: npm 7

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
yyx990803commented, Jan 11, 2021

It should break if the package itself provide broken info. Silently falling back and let it work, even with a warning, the result is you never bother filing the issue to the original package and it never gets fixed.

To get a temporary fix you can always manually alias it to the umd entry.

1reaction
yyx990803commented, Jan 11, 2021

In think in this case it should fail explicitly. Implicitly falling back means you will be using an umd version that enjoys no treeshaking.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Paged Break, the long overdue update - Paged.js —
Between June last year and this month of July, we've been through a lot of small changes, going from 0.2.0 to 0.4.1 beta...
Read more >
Sveltejs with Paged.js - Cabbage Tree Labs Support
Hello I'm trying to use Paged.js in Sveltekit. ... .cabbagetreelabs.org/t/sveltejs-with-paged-js/91/1 > Not really a regression: beta.20 now ...
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