`visualize()` returns wrong type when loading from `vite` in TypeScript.
See original GitHub issueOS & 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
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:
- Created a year ago
- Comments:5 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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