Skip to content

Cannot set property on #<Object> which has only a getter #39195

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

Closed
mjbvz opened this issue Jun 22, 2020 · 2 comments · Fixed by #39213
Closed

Cannot set property on #<Object> which has only a getter #39195

mjbvz opened this issue Jun 22, 2020 · 2 comments · Fixed by #39213
Assignees
Labels
Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status.

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Jun 22, 2020

TypeScript Version: 4.0.0-dev.20200622

Search Terms:

Repo

  1. In the VS Code code base
  2. Revert this change in grid.ts
  3. Recompile VS Code (yarn run watch
  4. Start VS Code

Bug:

VS Code doesn't start due to the following exception

/Users/matb/projects/vscode/out/bootstrap-window.js:215 TypeError: Cannot set property GridViewSizing of #<Object> which has only a getter
    at Object.<anonymous> (/Users/matb/projects/vscode/out/vs/base/browser/ui/grid/grid.js:136)
    at Function.Module._invokeFactory (/Users/matb/projects/vscode/out/vs/loader.js:1040)
    at Module.complete (/Users/matb/projects/vscode/out/vs/loader.js:1050)
    at ModuleManager._onModuleComplete (/Users/matb/projects/vscode/out/vs/loader.js:1671)
...

This is triggered on a line that looks like:

    exports.GridViewSizing = Sizing;
@mjbvz
Copy link
Contributor Author

mjbvz commented Jun 22, 2020

@RyanCavanaugh This seems like a regression from 4.0.0-dev.20200615. Possibly related to #38809?

@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Jun 23, 2020
@RyanCavanaugh RyanCavanaugh added this to the Typescript 4.0.1 milestone Jun 23, 2020
@weswigham
Copy link
Member

Wow, so it looks like there's a bug in our namespace export emit - namely, export namespace Sizing is adopting the reexport from
export { Orientation, Sizing as GridViewSizing, IViewSize, orthogonal, LayoutPriority } from './gridview'; - there shouldn't be a exports.GridViewSizing = Sizing;, since the local Sizing namespace isn't exported as GridViewSizing. Here's a minimal repro:

// @filename: gridview.ts
export type Sizing = any;
export namespace Sizing {
	export const Distribute = { type: 'distribute' };
}
// @filename: index.ts
export { Sizing as GridViewSizing } from './gridview';
export namespace Sizing {
	export const Distribute = { type: 'distribute' };
}

I'm working on it now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fix Available A PR has been opened for this issue Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants