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.

Api object recurrence causes an error when working with typescript.

See original GitHub issue

Describe 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:closed
  • Created 4 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
chymzcommented, Aug 29, 2019

It will be fixed in next version.

As a workaround, you can put this in vue.config.js:

module.exports = {
  chainWebpack(config) {
    config.entryPoints
      .get('app')
      .clear()
      .add(require.resolve('@uvue/core/client'));
  },
};

(On next update of this plugin, you need to remove this code)

0reactions
chymzcommented, Nov 4, 2019

Fixed in v0.1.1

Read more comments on GitHub >

github_iconTop 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 >

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