Skip to content

On webpack run: "TypeError: Cannot read property 'name' of undefined" #502

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
aight8 opened this issue Mar 16, 2017 · 9 comments
Closed
Labels

Comments

@aight8
Copy link

aight8 commented Mar 16, 2017

If transpileOnly is true it works. However this is not a permanent solution.
Webpack builds very long time and the memory of the webpack process increases over 1.5 GB, until node.js ran out of memory. I literally build just a ts file as entry point which contains console.log('abc').

ts-loader: Using /Users/aight8/my-project/node_modules/typescript@2.2.1. This version may or may not be compatible with ts-loader.
ts-loader: Using config file at /Users/aight8/my-project/tsconfig.json

/Users/aight8/my-project/node_modules/typescript/lib/typescript.js:25122
                error(source.valueDeclaration.name, ts.Diagnostics.Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity, symbolToString(target));
                                             ^
TypeError: Cannot read property 'name' of undefined
    at mergeSymbol (/Users/aight8/my-project/node_modules/typescript/lib/typescript.js:25122:46)
    at /Users/aight8/my-project/node_modules/typescript/lib/typescript.js:25146:21
    at Map.forEach (native)
    at mergeSymbolTable (/Users/aight8/my-project/node_modules/typescript/lib/typescript.js:25136:20)
    at mergeSymbol (/Users/aight8/my-project/node_modules/typescript/lib/typescript.js:25117:21)
    at /Users/aight8/my-project/node_modules/typescript/lib/typescript.js:25146:21
    at Map.forEach (native)
    at mergeSymbolTable (/Users/aight8/my-project/node_modules/typescript/lib/typescript.js:25136:20)
    at mergeSymbol (/Users/aight8/my-project/node_modules/typescript/lib/typescript.js:25117:21)
    at /Users/aight8/my-project/node_modules/typescript/lib/typescript.js:25146:21

Ts config is currently:

{
    "compilerOptions": {
        "noImplicitAny": false,
        "strictNullChecks": false,
        "moduleResolution": "node",
        "target": "es2017",
        "outDir": "bin",
        "sourceMap": true,
        "module": "commonjs",
        "typeRoots": [
            "node_modules/@types"
        ],
        "pretty": true
    },
    "include": [
        "src"
    ]
}

However I tested various other settings. The error stays the same.

Tested with typescript 2.2.1 and 2.3-nightly

Parallel issue in awesome-typescript-loader: s-panferov/awesome-typescript-loader#395

@johnnyreilly
Copy link
Member

I've a feeling there are issues with typeRoots - though i forget the specifics...

@lbguilherme
Copy link

Looks like this was fixed by pull microsoft/TypeScript#15075, issue microsoft/TypeScript#14628. Will be released as TS 2.3.1 soon.

@lbguilherme
Copy link

2.3.1 was released and still contains the bug, you can use typescript@next. The fix was NOT released, but resides in master for 2.4.0. They really should release this.

@Opty1712
Copy link

Opty1712 commented Jun 9, 2017

Got same error. Any news?

@johnnyreilly
Copy link
Member

Assuming 2.4 resolved it then hang tight for that. It'll be out soon

@johnnyreilly
Copy link
Member

Oh and you could try making use of the fork-ts-checker-webpack-plugin (see our docs). It should be run with ts-loader in transpile mode and so might not be affected. Worth a try anyway (perf boost either way!)

@stale
Copy link

stale bot commented Jan 19, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

1 similar comment
@stale
Copy link

stale bot commented Mar 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Mar 20, 2019
@stale
Copy link

stale bot commented Mar 27, 2019

Closing as stale. Please reopen if you'd like to work on this further.

@stale stale bot closed this as completed Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants