Runtime error on import { hbs } from 'ember-cli-htmlbars' in storybook
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, webpack
- Domain
- frontend
Research direction
Reproduce the failure in the linked Storybook Ember example, then trace the import from lib/utils.js through hash-for-dep/module-entry.js and resolve-package-path/lib/should-preserve-symlinks.ts. Check how the browser's webpack process shim handles process.execArgv. Done means the example imports hbs without a runtime error, or the package's browser support is clearly documented.
Written by the indexing model from the issue text.
Description
Is ember-cli-htmlbars expected to work in browser context? The storybook example https://github.com/storybookjs/storybook/blob/1f27b252a66e48f4f7106ef7ccc7950a5b715c32/examples/ember-cli/stories/index.stories.js#L1 throws an error at runtime
Cannot read property 'length' of undefined
TypeError: Cannot read property 'length' of undefined
at includes (http://localhost:6006/vendors~main.925bee91ab6e54312329.bundle.js:113614:31)
at push../node_modules/resolve-package-path/lib/should-preserve-symlinks.js.module.exports (http://localhost:6006/vendors~main.925bee91ab6e54312329.bundle.js:113622:52)
at Object.<anonymous> (http://localhost:6006/vendors~main.925bee91ab6e54312329.bundle.js:113404:25)
This happens because ember-cli-htmlbars/utils.js requires hash-for-dep
https://github.com/ember-cli/ember-cli-htmlbars/blob/aee846034a6b6772fef7675dad2156e69b40df8e/lib/utils.js#L5
hash-for-dep/module-entry.js requires resolve-package-path
https://github.com/stefanpenner/hash-for-dep/blob/f4cc06e526a36f83427b8ce1a6da2ea616112278/lib/module-entry.js#L3
Which accesses process.execArgv which is not defined on webpack's process shim
https://github.com/stefanpenner/resolve-package-path/blob/3e9b74512521c69609e84736e64d8e21c52a0c55/lib/should-preserve-symlinks.ts#L17
https://github.com/webpack/node-libs-browser/issues/78
Is this issue exclusive to me? Are others facing this as well? Am I missing some config
Downstream Issue: https://github.com/storybookjs/ember-cli-storybook/issues/35
- Dominant language
- JavaScript
- Stars
- 77
- Forks
- 65
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ember-cli/ember-cli-htmlbars
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
ember-cli/ember-cli-htmlbars#792 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ember-cli/ember-cli-htmlbars#787 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 38/100
ember-cli/ember-cli-htmlbars#781 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ember-cli/ember-cli-htmlbars#779 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ember-cli/ember-cli-htmlbars#774 · 2 comments ·
All issues in ember-cli/ember-cli-htmlbars
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·