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.

Compatibility with AngularCompilerPlugin

See original GitHub issue

Is this plugin compatible with AngularCompilerPlugin? I keep getting the following error:

TypeError: Cannot read property 'data' of undefined
    at setData (/Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack-virtual-modules/index.js:79:15)
    at VirtualFileSystemDecorator.compiler.inputFileSystem._writeVirtualFile (/Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack-virtual-modules/index.js:108:9)
    at VirtualModulesPlugin.writeModule (/Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack-virtual-modules/index.js:59:34)
    at /Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack-virtual-modules/index.js:155:14
    at Array.forEach (<anonymous>)
    at afterResolversHook (/Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack-virtual-modules/index.js:154:40)
    at SyncHook.eval [as call] (eval at create (/Users/ben/projects/sopher.io/sites/webapp/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:5:1)
    at SyncHook.lazyCompileHook (/Users/ben/projects/sopher.io/sites/webapp/node_modules/tapable/lib/Hook.js:154:20)
    at WebpackOptionsApply.process (/Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack/lib/WebpackOptionsApply.js:541:33)
    at webpack (/Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack/lib/webpack.js:57:48)
    at processOptions (/Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack-cli/bin/cli.js:272:16)
    at /Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack-cli/bin/cli.js:364:3
    at Object.parse (/Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack-cli/node_modules/yargs/yargs.js:567:18)
    at /Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack-cli/bin/cli.js:49:8
    at Object.<anonymous> (/Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack-cli/bin/cli.js:366:3)
    at Module._compile (internal/modules/cjs/loader.js:1123:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:972:32)
    at Function.Module._load (internal/modules/cjs/loader.js:872:14)
    at Module.require (internal/modules/cjs/loader.js:1012:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/Users/ben/projects/sopher.io/sites/webapp/node_modules/webpack/bin/webpack.js:156:2)
    at Module._compile (internal/modules/cjs/loader.js:1123:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:972:32)
    at Function.Module._load (internal/modules/cjs/loader.js:872:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47

This is an excerpt of the plugins in the webpack.config.js:

 plugins: [
    new VirtualModulesPlugin({
      'node_modules/module-foo.js': 'module.exports = { foo: "foo" };'
    }),
    new AngularCompilerPlugin({
      tsConfigPath: path.resolve(TSCONFIG),
      sourceMap: SOURCE_MAPS
    })
]

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
larixercommented, Apr 24, 2020

@neben @ScriptedAlchemy The compatibility with AngularCompilerPlugin is added via: #46. Published as webpack-virtual-modules@0.2.2

0reactions
edusperonicommented, May 5, 2021

This seems to be broken again. It outputs an empty script when AngularCompilerPlugin is used.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issue #186 · webpack-contrib/mini-css-extract-plugin - GitHub
Compatibility with AngularCompilerPlugin #186 ... I'm not able to use mini-css-extract-plugin with AngularCompilerPlugin (i.e., I'm not able to set ...
Read more >
Angular Ahead-of-Time Webpack Plugin - npm
Angular version 5 and up, use AngularCompilerPlugin : ... The loader works with webpack plugin to compile your TypeScript.
Read more >
ngtools/webpack AngularCompilerPlugin Configuration for ...
AngularCompilerPlugin when my project is a library project and therefore ... getDefaultExport function for compatibility with non-harmony ...
Read more >
@ngtools/webpack NPM | npm.io
Angular version 5 and up, use AngularCompilerPlugin : import {AngularCompilerPlugin} ... The loader works with webpack plugin to compile your TypeScript.
Read more >
Getting started with Webpack Ahead-of-Time Configuration
It works with AngularCompilerPlugin together to enable AOT compilation. Options for AngularCompilerPlugin. Add instance of AngularCompilerPlugin, which has an ...
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