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

ng-annotate-webpack-plugin: Error: StringMap expected string key #27

Open
pallakartheekreddy opened this issue May 20, 2019 · 2 comments

Comments

@pallakartheekreddy
Copy link

pallakartheekreddy commented May 20, 2019

My Webpack Config file having below code:

const ngAnnotatePlugin = require('ng-annotate-webpack-plugin');

plugins: [
.......
new ngAnnotatePlugin({
                add: true,
            }),
.....]

ERROR: throw new Error("StringMap expected string key");
Error: StringMap expected string key at stringmap.set

When we remove ng-annotate-webpack-plugin we are not getting above error.

@pallakartheekreddy pallakartheekreddy changed the title ng-annotate-webpack-plugin: Error: StringMap expected string key at stringmap.set ng-annotate-webpack-plugin: Error: StringMap expected string key May 20, 2019
@jeffling
Copy link
Owner

Can we see the full stack trace?

@stevenvachon
Copy link

stevenvachon commented Jan 16, 2020

Perhaps mine will help:

/project/node_modules/stringmap/stringmap.js:99
            throw new Error("StringMap expected string key");
            ^

Error: StringMap expected string key
    at stringmap.set (/project/node_modules/stringmap/stringmap.js:99:19)
    at Scope.add (/project/node_modules/ng-annotate-webpack-plugin/node_modules/ng-annotate/build/es5/scope.js:102:17)
    at /project/node_modules/ng-annotate-webpack-plugin/node_modules/ng-annotate/build/es5/scopetools.js:65:25
    at Array.forEach (<anonymous>)
    at createScopes (/project/node_modules/ng-annotate-webpack-plugin/node_modules/ng-annotate/build/es5/scopetools.js:64:21)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:25:19)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:46:21)
    at visit (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:43:25)
    at traverse (/project/node_modules/ordered-ast-traverse/ordered-ast-traverse.js:56:5)
    at Object.setupScopeAndReferences (/project/node_modules/ng-annotate-webpack-plugin/node_modules/ng-annotate/build/es5/scopetools.js:18:5)
    at ngAnnotate (/project/node_modules/ng-annotate-webpack-plugin/node_modules/ng-annotate/build/es5/ng-annotate-main.js:1123:16)
    at annotateFile (/project/node_modules/ng-annotate-webpack-plugin/index.js:27:29)
    at Array.forEach (<anonymous>)
    at /project/node_modules/ng-annotate-webpack-plugin/index.js:53:19
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:31:1)
    at AsyncSeriesHook.lazyCompileHook (/project/node_modules/tapable/lib/Hook.js:154:20)
    at /project/node_modules/webpack/lib/Compilation.js:1311:36
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/project/node_modules/tapable/lib/Hook.js:154:20)
    at /project/node_modules/webpack/lib/Compilation.js:1307:32
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at AsyncSeriesHook.lazyCompileHook (/project/node_modules/tapable/lib/Hook.js:154:20)
    at Compilation.seal (/project/node_modules/webpack/lib/Compilation.js:1244:27)
    at /project/node_modules/webpack/lib/Compiler.js:624:17
    at _done (eval at create (/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
    at eval (eval at create (/project/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:56:22)

This may be helpful?:
https://stackoverflow.com/questions/45980598/ngannotate-warning-stringmap-expected-string-key

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants