Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode Redwood IDE Error "Cannot read property 'toString' of undefined" when using "Redwood: Generate..." #2040

Closed
Tracked by #3887
dariusj18 opened this issue Mar 19, 2021 · 4 comments

Comments

@dariusj18
Copy link

dariusj18 commented Mar 19, 2021

VS Code version 1.54.3
Redwood IDE version 0.0.21

Other VS Code commands stop working once this is encountered as well.

ERR Cannot read property 'toString' of undefined: TypeError: Cannot read property 'toString' of undefined
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:124:31971
    at Array.map (<anonymous>)
    at a.splice (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:124:31924)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3:141609
    at Array.forEach (<anonymous>)
    at t.splice (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3:141596)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:142:7690
    at bufferEvents (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:57:3689)
    at P.splice (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:142:7657)
    at h.setElements (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:568:24200)
    at w.update (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:568:42123)
    at w.set items [as items] (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:568:34894)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:568:52889

also happens when executing "Redwood: Interactive CLI..."

ERR Cannot read property 'toString' of undefined: TypeError: Cannot read property 'toString' of undefined
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:124:31971
    at Array.map (<anonymous>)
    at a.splice (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:124:31924)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3:141609
    at Array.forEach (<anonymous>)
    at t.splice (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:3:141596)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:142:7690
    at bufferEvents (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:57:3689)
    at P.splice (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:142:7657)
    at h.setElements (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:568:24200)
    at w.update (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:568:42123)
    at w.set items [as items] (file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:568:34894)
    at file:///C:/Program Files/Microsoft VS Code/resources/app/out/vs/workbench/workbench.desktop.main.js:568:52889
@thedavidprice
Copy link
Contributor

Hi @dariusj18 Thanks for opening this Issue. The VSCode Extension is currently undergoing a major re-write by @aldonline It might be another few weeks, but look for some progress coming soon.

@aldonline
Copy link
Contributor

aldonline commented Mar 20, 2021

Hey @dariusj18!

I can't tell for sure where this is coming from, but here's some context.

The Interactive CLI is a partial wrapper of the actual CLI that enables a different interaction model.
For example. Here's the CLI's implementation of the "generate page" command:

And here's how the Interactive CLI does it.

As you can see, they are quite different. The CLI uses Yargs, and the Interactive CLI uses a more programmatic approach that supports control flow logic. When I contributed this, the idea was for both packages to keep evolving in tandem, but the CLI has evolved independently and the Interactive CLI hasn't been updated at all.

I plan to fix all of this in the future by bringing everything into a single project and using a smarter way to declare the CLI.

This type of issue (divergence in the codebase as packages grow in different directions) is a systemic problem in monorepos and other code organization structures that sanction drawing arbitrary lines in the sand early on.

@jacebot
Copy link

jacebot commented Apr 4, 2021

I recently ran the upgrade to the latest version and this error appeared as I started up the dev server.

Hope this helps too.

internal/modules/cjs/loader.js:1022
  throw err;
  ^

Error: Cannot find module 'core-js-pure/features/object/define-property'

@jtoar jtoar mentioned this issue Dec 10, 2021
23 tasks
@jtoar jtoar added this to Main May 5, 2022
@jtoar jtoar moved this to Backlog in Main May 5, 2022
@jtoar
Copy link
Contributor

jtoar commented May 5, 2022

See #3887 (comment).

@jtoar jtoar closed this as completed May 5, 2022
Repository owner moved this from Backlog to Done in Main May 5, 2022
@jtoar jtoar moved this from Done to Archived in Main May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Archived
Development

No branches or pull requests

6 participants