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

Error: Can't resolve 'fs' #374

Closed
gossi opened this issue Nov 30, 2019 · 2 comments
Closed

Error: Can't resolve 'fs' #374

gossi opened this issue Nov 30, 2019 · 2 comments

Comments

@gossi
Copy link

gossi commented Nov 30, 2019

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:

  1. import hbs from "htmlbars-inline-precompile";
  2. 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.

Repro

Available here: https://github.com/gossi/repro-ember-cli-htmlbars-hbs-export

@rwjblue
Copy link
Member

rwjblue commented Dec 12, 2019

Closing in favor of working on it over in storybookjs/ember-cli-storybook#20.

@rwjblue rwjblue closed this as completed Dec 12, 2019
@dbendaou
Copy link

Thanks !

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