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

Build fails when used with hard-source-webpack-plugin #136

Open
alavkx opened this issue Feb 13, 2018 · 8 comments
Open

Build fails when used with hard-source-webpack-plugin #136

alavkx opened this issue Feb 13, 2018 · 8 comments

Comments

@alavkx
Copy link

alavkx commented Feb 13, 2018

Not sure if this is an issue with aurelia-webpack-plugin or hard-source-webpack-plugin. Builds successfully after removing AureliaWebpackPlugin from the config. Also opened an issue on hard source's repo.

I'm submitting a bug report

  • Library Version:
    2.0.0-rc.5

  • Operating System:
    Windows 10

  • Node Version:
    9.4.0

  • NPM Version:
    5.6.0

  • Webpack Version
    Webpack 3.10.0

Current behavior:
When building project using webpack and hard-source-webpack-plugin, build fails with following error.

Unhandled rejection TypeError: Cannot read property 'has' of undefined
at importedNames.importedModule.providedExports.filter.id (C:\webpack-test\app\scheduling\node_modules\webpack\lib\dependencies\HarmonyExportImportedSpecifierDependency.js:78:28)
at Array.filter ()
at HardHarmonyExportImportedSpecifierDependency.getReference (C:\webpack-test\app\scheduling\node_modules\webpack\lib\dependencies\HarmonyExportImportedSpecifierDependency.js:76:51)
at processDependency (C:\webpack-test\app\scheduling\node_modules\webpack\lib\FlagDependencyUsagePlugin.js:52:48)
at depBlock.dependencies.forEach.dep (C:\webpack-test\app\scheduling\node_modules\webpack\lib\FlagDependencyUsagePlugin.js:46:43)
at Array.forEach ()
at processDependenciesBlock (C:\webpack-test\app\scheduling\node_modules\webpack\lib\FlagDependencyUsagePlugin.js:46:28)
at Compilation.compilation.plugin.modules (C:\webpack-test\app\scheduling\node_modules\webpack\lib\FlagDependencyUsagePlugin.js:23:6)
at Compilation.applyPluginsBailResult1 (C:\webpack-test\app\scheduling\node_modules\tapable\lib\Tapable.js:140:27)
at Compilation.seal (C:\webpack-test\app\scheduling\node_modules\webpack\lib\Compilation.js:597:9)
at applyPluginsParallel.err (C:\webpack-test\app\scheduling\node_modules\webpack\lib\Compiler.js:504:17)
at C:\webpack-test\app\scheduling\node_modules\tapable\lib\Tapable.js:289:11
at C:\webpack-test\app\scheduling\node_modules\html-webpack-plugin\index.js:60:9
at tryCatcher (C:\webpack-test\app\scheduling\node_modules\bluebird\js\release\util.js:16:23)
at Promise._settlePromiseFromHandler (C:\webpack-test\app\scheduling\node_modules\bluebird\js\release\promise.js:512:31)
at Promise._settlePromise (C:\webpack-test\app\scheduling\node_modules\bluebird\js\release\promise.js:569:18)
at Promise._settlePromise0 (C:\webpack-test\app\scheduling\node_modules\bluebird\js\release\promise.js:614:10)
at Promise._settlePromises (C:\webpack-test\app\scheduling\node_modules\bluebird\js\release\promise.js:693:18)
at Async._drainQueue (C:\webpack-test\app\scheduling\node_modules\bluebird\js\release\async.js:133:16)
at Async._drainQueues (C:\webpack-test\app\scheduling\node_modules\bluebird\js\release\async.js:143:10)
at Immediate.Async.drainQueues [as _onImmediate] (C:\webpack-test\app\scheduling\node_modules\bluebird\js\release\async.js:17:14)
at runCallback (timers.js:756:18)
at tryOnImmediate (timers.js:717:5)
at processImmediate [as _immediateCallback] (timers.js:697:5)

Expected/desired behavior:
Webpack successfully completes build

@jods4
Copy link
Contributor

jods4 commented Feb 20, 2018

Looking at the stack trace above, it seems an internal structure of HarmonyExportImportedSpecifierDependency, most likely this.activeExports or activeFromOtherStarExports is unexpectedly undefined.

Harmony exports is not something that our plugin manipulates directly and there's only Webpack / HardHarmonyExportImportedSpecifierDependency. I suggest we wait on hard-source-webpack-plugin analysis of the problem because it seems we are merely triggering a buggy condition in their code.

@zakjan
Copy link

zakjan commented Jul 24, 2018

With hard-source-webpack-plugin, we're getting a lot of these errors:

Could not freeze xxx.(html|ts): Unfrozen dependencies (1 / 1): IncludeDependency

Is it related, or a different bug?

@7iomka
Copy link

7iomka commented Sep 14, 2018

Same problem with Could not freeze xxx
http://s3.micp.ru/c10FP.jpg

@thavlik
Copy link

thavlik commented Sep 18, 2018

I am getting this issue as well, suddenly, and I think it was caused by cancelling a build.

@jods4
Copy link
Contributor

jods4 commented Oct 11, 2018

Is the original issue fixed with newer hard-source releases?

I am not familiar with hard-source so any help here is welcome.
IncludeDependency is an internal object of AureliaPlugin.
I don't know when hard-source tries to freeze it and why it can't... Or should AureliaPlugin freeze it?
This object is not immutable so I'm not sure when we should freeze it for hard-source to work.

If anyone wants to analyse this, feel free to ask questions here.

@FrankCamp
Copy link

I am also getting the freeze issue.
Is there a fix/workaround?
If not, what needs to be done to fix it?

@smancang
Copy link

use "hard-source-webpack-plugin-fixed-hashbug" instead. I've already have a try, it works.

akrolsmir added a commit to akrolsmir/streamlit that referenced this issue Jun 22, 2020
akrolsmir added a commit to streamlit/streamlit that referenced this issue Jun 22, 2020
* Change Husky pre-commit hook to work on Windows

Source: typicode/husky#281

* Update protobufjs to resolve TS compilation on Windows

Source: protobufjs/protobuf.js#1275

* Switch to a patched version of hard-source

aurelia/webpack-plugin#136

* Use `env` instead of `export` for Windows compatibility

https://stackoverflow.com/questions/25112510/how-to-set-environment-variables-from-within-package-json
@ToniNichevNBCUNI
Copy link

hard-source-webpack-plugin-fixed-hashbug is disabling HMR. Anny suggestions ?

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

No branches or pull requests

8 participants