Api object recurrence causes an error when working with typescript.
See original GitHub issueDescribe the bug A clear and concise description of what the bug is.
To Reproduce
Install "@vue/cli-plugin-typescript": "^3.8.0"
and put uvue after it dependence in package.json
Expected behavior
Run npm run ssr:build
or npm run build
It throw error
TypeError: Converting circular structure to JSON
at JSON.stringify (<anonymous>)
at PoolWorker.writeJson (/projects/project/node_modules/thread-loader/dist/WorkerPool.js:116:44)
at PoolWorker.run (/projects/project/node_modules/thread-loader/dist/WorkerPool.js:100:10)
at WorkerPool.distributeJob (/projects/project/node_modules/thread-loader/dist/WorkerPool.js:332:15)
at runQueue (/projects/project/node_modules/thread-loader/node_modules/neo-async/async.js:8097:9)
at process._tickCallback (internal/process/next_tick.js:61:11)
ERROR Error: Command failed: /projects/project/node_modules/@vue/cli-service/bin/vue-cli-service.js build --modern
Error: Command failed: /projects/project/node_modules/@vue/cli-service/bin/vue-cli-service.js build --modern
at makeError (/projects/project/node_modules/execa/index.js:174:9)
at Promise.all.then.arr (/projects/project/node_modules/execa/index.js:278:16)
at process._tickCallback (internal/process/next_tick.js:68:7)
I don’t know if is a typescript loader, but moving dependence, it fails,
I’ve identified that problem is this: @uvue/vue-cli-plugin-ssr/uvue/index.js
constructor(api) { // Constructor de UVueApi
this.api = api;
and @uvue/vue-cli-plugin-ssr/index.js
api.uvue = new UVueAPI(api);
After the PoolWorker
wants to serialize it and it fails.
I have a solution, but it need to you evaluate it, and add a test. I will pull request.
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
Take control of unexpected data at runtime with TypeScript
In this article, we'll explore how to use TypeScript type definitions to get better guarantees for runtime safety.
Read more >TypeScript errors and how to fix them
You cannot reference a file to itself (causes recursive loop). To fix the problem you have to update the reference path to point...
Read more >Documentation - TypeScript 4.6
TypeScript now shows JavaScript syntax and binding errors in your file, such as using incorrect modifiers, duplicate declarations, and more. These will ...
Read more >TypeScript 4.6 Beta Improves Type Inference and Error ... - InfoQ
Thanks to better recursion depth checks, TypeScript is now better at identifying errors caused by infinitely expanding generic types.
Read more >Error - JavaScript - MDN Web Docs - Mozilla
Runtime errors result in new Error objects being created and thrown. Error is a serializable object, so it can be cloned with structuredClone() ......
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
It will be fixed in next version.
As a workaround, you can put this in
vue.config.js
:(On next update of this plugin, you need to remove this code)
Fixed in
v0.1.1