You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So, I was playing around with storybook, which imports hbs. I originally have this in a monorepo, where one package contains the storybook and the stories are spread amongst the respective packages. I also created a reproduction repo (which has only one package).
Since v4, there are two import paths available:
import hbs from "htmlbars-inline-precompile";
import { hbs } from "ember-cli-htmlbars";
I tried both of them and depending whether this is a monorepo or not, they function differently:
Import Path
Single Package
Monorepo
htmlbars-inline-precompile
works
works from files of the own package, error from other packages*
ember-cli-htmlbars
Error fs
Error fs
* Regarding the monorepo. There are multiple packages, one contains the storybook and configures it and there are other packages that contain the stories for their respective parts. The import only works on the package that also contains the config for storybook. Given that import { hbs } from "ember-cli-htmlbars"; is the way forward - I kinda ignored that fact a little that this import path works (it's ok as a workaround for now).
Error: Can't resolve 'fs'
This is an error that appears plenty of times. To better understand it, run the repro and start it, then the console is splattered with multiple of these error messages.
So, I was playing around with storybook, which imports
hbs
. I originally have this in a monorepo, where one package contains the storybook and the stories are spread amongst the respective packages. I also created a reproduction repo (which has only one package).Since v4, there are two import paths available:
import hbs from "htmlbars-inline-precompile";
import { hbs } from "ember-cli-htmlbars";
I tried both of them and depending whether this is a monorepo or not, they function differently:
htmlbars-inline-precompile
ember-cli-htmlbars
fs
fs
* Regarding the monorepo. There are multiple packages, one contains the storybook and configures it and there are other packages that contain the stories for their respective parts. The import only works on the package that also contains the config for storybook. Given that
import { hbs } from "ember-cli-htmlbars";
is the way forward - I kinda ignored that fact a little that this import path works (it's ok as a workaround for now).Error: Can't resolve 'fs'
This is an error that appears plenty of times. To better understand it, run the repro and start it, then the console is splattered with multiple of these error messages.
Repro
Available here: https://github.com/gossi/repro-ember-cli-htmlbars-hbs-export
The text was updated successfully, but these errors were encountered: