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 Error (broccoli-persistent-filter:EslintValidationFilter) in mirage/config.js #1399

Closed
beerlington opened this issue Oct 18, 2018 · 7 comments
Labels

Comments

@beerlington
Copy link

Hey! Our team has run into this a few times and my google skills are failing me so I wanted to just open an issue in case anyone else runs into this.

Basically after installing mirage in a barebones ember app using eslint, it will no longer boot.

We get the following error:

~/code/mirage-build-error(master ✗) ember s
Build Error (broccoli-persistent-filter:EslintValidationFilter) in mirage/config.js

ENOENT: no such file or directory, scandir '/Users/peterbrown/code/mirage-build-error/mirage/mirage'


Stack Trace and Error Report: /var/folders/00/cnxym0wj0xs99j7x1hc12d8w0000gn/T/error.dump.fd7024b25d9a2f9dc1894b21d55cf0c9.log

I have a public repo where you can see the issue - https://github.com/beerlington/mirage-build-error

The first commit in the repo boots the app fine. The second commit adds mirage and then no longer boots.

The fix for this is to add the following to .eslintignore:

/mirage/mirage

and then the server boots.

Just for search purposes, the full stack trace of the error is:

ERROR Summary:

  - broccoliBuilderErrorStack: Error: ENOENT: no such file or directory, scandir '/Users/peterbrown/code/mirage-build-error/mirage/mirage'
    at Object.fs.readdirSync (fs.js:904:18)
    at traverseFolder (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:32564:18)
    at findRoot (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:32580:10)
    at maybeParse (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:32592:16)
    at editorconfigSyncNoCache (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:32605:35)
    at editorconfigSyncNoCache (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:28538:20)
    at /Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:34796:14
    at Array.map (<anonymous>)
    at _resolveConfig (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:34795:40)
    at Function.resolveConfig.sync (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:34831:12)
  - codeFrame: ENOENT: no such file or directory, scandir '/Users/peterbrown/code/mirage-build-error/mirage/mirage'
  - errorMessage: mirage/config.js: ENOENT: no such file or directory, scandir '/Users/peterbrown/code/mirage-build-error/mirage/mirage'
        in /var/folders/00/cnxym0wj0xs99j7x1hc12d8w0000gn/T/broccoli-61403MQQE2vc6x3MP/out-139-funnel
        at broccoli-persistent-filter:EslintValidationFilter
  - errorType: Build Error
  - location:
    - column: [undefined]
    - file: mirage/config.js
    - line: [undefined]
    - treeDir: /var/folders/00/cnxym0wj0xs99j7x1hc12d8w0000gn/T/broccoli-61403MQQE2vc6x3MP/out-139-funnel
  - message: mirage/config.js: ENOENT: no such file or directory, scandir '/Users/peterbrown/code/mirage-build-error/mirage/mirage'
        in /var/folders/00/cnxym0wj0xs99j7x1hc12d8w0000gn/T/broccoli-61403MQQE2vc6x3MP/out-139-funnel
        at broccoli-persistent-filter:EslintValidationFilter
  - name: BuildError
  - nodeAnnotation: [undefined]
  - nodeName: broccoli-persistent-filter:EslintValidationFilter
  - originalErrorMessage: ENOENT: no such file or directory, scandir '/Users/peterbrown/code/mirage-build-error/mirage/mirage'
  - stack: Error: ENOENT: no such file or directory, scandir '/Users/peterbrown/code/mirage-build-error/mirage/mirage'
    at Object.fs.readdirSync (fs.js:904:18)
    at traverseFolder (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:32564:18)
    at findRoot (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:32580:10)
    at maybeParse (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:32592:16)
    at editorconfigSyncNoCache (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:32605:35)
    at editorconfigSyncNoCache (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:28538:20)
    at /Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:34796:14
    at Array.map (<anonymous>)
    at _resolveConfig (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:34795:40)
    at Function.resolveConfig.sync (/Users/peterbrown/code/mirage-build-error/node_modules/prettier/index.js:34831:12)
@beerlington
Copy link
Author

@samselikoff I have no idea if this is mirage-specific so feel free to close if it doesn't seem relevant. I really just wanted to open it in case we forget and start googling the error again. 🎈

@samselikoff
Copy link
Collaborator

Very bizarre - thanks for reporting!

Going to be tackling Mirage bugs next week so will look then 👍

@esbanarango
Copy link

I'm having the same issue here with a brand new Ember app using eslint. 🤚

@ezpuzz
Copy link

ezpuzz commented Nov 9, 2018

eslint-plugin-prettier doesn't resolve paths correctly

workaround: hold eslint-plugin-prettier to 2.6.0

ember-cli/ember-cli-eslint#235

@samselikoff
Copy link
Collaborator

@ezpuzz Thank you – that seemed to fix @beerlington's issue for me as well!

I didn't fully understand the discussion over there... is a more "permanent" fix coming in the form of an updated eslint-plugin-prettier package or is there a different long-term solution?

(Sidenote – Prettier is awesome and seems to work well with JS files in Ember! Why have I not been using it?!)

@samselikoff
Copy link
Collaborator

For now, should we add some Prettier install instructions to Mirage's docs? Trying to figure out what Mirage's responsibility is here

backspace added a commit to backspace/prison-rideshare-ui that referenced this issue Dec 15, 2018
@samselikoff
Copy link
Collaborator

samselikoff commented Jan 6, 2019

Looks like that paths RFC got merged for Ember CLI, so there's a longer-term fix on the way. For now I just added some documentation to the Install step that warns Prettier users to either pin the version or add the line to the ignore file:

image

Closing for now, thanks everyone!

LevelbossMike added a commit to LevelbossMike/ember-statecharts that referenced this issue Apr 7, 2019
We need to pin `eslint-plugin-prettier` to 2.6.0

See following github issue for reason why:

miragejs/ember-cli-mirage#1399

Regarding prettierrc-configuration. We will use same config
as `emberjs/ember.js` for constistency.
LevelbossMike added a commit to LevelbossMike/ember-statecharts that referenced this issue Apr 7, 2019
We need to pin `eslint-plugin-prettier` to 2.6.0

See following github issue for reason why:

miragejs/ember-cli-mirage#1399

Regarding prettierrc-configuration. We will use same config
as `emberjs/ember.js` for constistency.
LevelbossMike added a commit to LevelbossMike/ember-statecharts that referenced this issue Apr 7, 2019
We need to pin eslint-plugin-prettier to 2.6.0 for now

See the following issue for reference:

miragejs/ember-cli-mirage#1399
LevelbossMike added a commit to LevelbossMike/ember-statecharts that referenced this issue Apr 7, 2019
We need to pin eslint-plugin-prettier to 2.6.0 for now

See the following issue for reference:

miragejs/ember-cli-mirage#1399
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants