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.

`visualize()` returns wrong type when loading from `vite` in TypeScript.

See original GitHub issue

OS & Node info


  • Operating System: Darwin (Mac OS)
  • Node Version: v16.14.2
  • Nuxt Version: 3.0.0-rc.9
  • Package Manager: yarn@3.2.2
  • Builder: vite
  • Runtime Modules: unplugin-icons/nuxt, @vueuse/nuxt@9.2.0, @intlify/nuxt3@0.2.4
  • Build Modules: -

Screenshot of the problem

image

I guess this is missing the Rollup config, which I’m not sure how to extract from nuxt, but I guess I can work on it if found helpful.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
btdcommented, Sep 25, 2022

I will probably close this as on my side there is no anything i can do for now. This issue actually must be created on vite+rollup side as they created mess with last releases. Vite 3.1 limit rollup version to 2.78.x Most of rollup plugins has rollup in peerDependencies, and a lot of them do not have complimentary meta entry to mark it optional. This causes always 2 rollup installations. One for vite and one for plugin. I fixed this in this plugin, but this could be caused now by any plugin now it seems. Which one will install rollup in the root first. If never installed in the root, when ts will see config for vite will use it its types.

0reactions
btdcommented, Sep 18, 2022

Problem is that you have 2 rollup versions, and it seems 2.79 are in root. I hoped vite 3.1 will update rollup, but it seem they did not. That change created so much mess. I will see if i can reorganize type structure, but i am worry it will be not possible until vite will align with last version of rollup. As workaround you can pin rollup to 2.78 or just cast plugin to PluginOptions

Read more comments on GitHub >

github_iconTop Results From Across the Web

`vite.config.ts` can't import untranspiled ts files from ... - GitHub
There are two workarounds: compile the ts file to the common js file, or specify the importee path to its real file path...
Read more >
Build Options - Vite
Returning a relative path to the hostId for hostType === 'js' is allowed, in which case new URL(dep, import.meta.url) is used to get...
Read more >
Error: 'types' can only be used in a .ts file - Visual Studio Code ...
I'm using flow with vscode but had the same problem. I solved it with these steps: Install the extension Flow Language Support.
Read more >
Documentation - Module Resolution - TypeScript
Module resolution is the process the compiler uses to figure out what an import refers to. Consider an import statement like import {...
Read more >
TypeScript | WebStorm Documentation - JetBrains
See Auto import to learn how to optimize import statements and configure their style. When you type your code or paste a fragment...
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