Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Webpack 4 Error: ENOENT: no such file or directory, scandir '//grant' #175

Open
robinComa opened this issue Dec 7, 2018 · 4 comments
Open
Labels

Comments

@robinComa
Copy link

robinComa commented Dec 7, 2018

Hello,

I'm trying to build my bundle with webpack and I have this issue :

fs.js:904
  return binding.readdir(pathModule._makeLong(path), options.encoding);
                 ^

Error: ENOENT: no such file or directory, scandir '//grant'
    at Object.fs.readdirSync (fs.js:904:18)
    at Object.<anonymous> (/Users/robincomadelperier/Documents/Workspace/airbus-helicopters/webtek-api/dist/bundle.js:87772:4)
    at Object.<anonymous> (/Users/robincomadelperier/Documents/Workspace/airbus-helicopters/webtek-api/dist/bundle.js:87807:30)
    at __webpack_require__ (/Users/robincomadelperier/Documents/Workspace/airbus-helicopters/webtek-api/dist/bundle.js:20:30)
    at Object.<anonymous> (/Users/robincomadelperier/Documents/Workspace/airbus-helicopters/webtek-api/dist/bundle.js:87695:18)
    at __webpack_require__ (/Users/robincomadelperier/Documents/Workspace/airbus-helicopters/webtek-api/dist/bundle.js:20:30)
    at Object.NODE_ENV (/Users/robincomadelperier/Documents/Workspace/airbus-helicopters/webtek-api/dist/bundle.js:87461:13)
    at __webpack_require__ (/Users/robincomadelperier/Documents/Workspace/airbus-helicopters/webtek-api/dist/bundle.js:20:30)
    at Object.<anonymous> (/Users/robincomadelperier/Documents/Workspace/airbus-helicopters/webtek-api/dist/bundle.js:128:16)
    at __webpack_require__ (/Users/robincomadelperier/Documents/Workspace/airbus-helicopters/webtek-api/dist/bundle.js:20:30)

My main.ts is really simple :

import * as osprey from 'osprey';
import * as express from 'express';
import * as path from 'path';

const app = express();

const printableError = (e) => {
    return `
${e.code} (${e.path} Li ${e.range.start.line}, Col ${e.range.start.column}) : 
${e.message}
`;
}

console.log(path.join(__dirname, 'assets', 'api.raml'))

osprey.loadFile(path.join(__dirname, 'assets', 'api.raml'), {})
    .then((middleware: any) => {
        app.use(middleware)

        app.use(function (err: any, req: Request, res: Response, next: Function) {
            console.error(`Error: ${err.message}`);
        })

        app.listen(3000);
    })
    .catch((err: any) => {
        console.error(`Error in the RAML of JSON SCHEMAS types :`);
        err.parserErrors.forEach((e) => {
            console.log(printableError(e));
        });
    });

It seems to be the import of osprey, I try const osprey = require('osprey') but same error.
Any Ideas ?

@robinComa
Copy link
Author

Same for me ... Any update ?

@robinComa
Copy link
Author

Haha 9 month latter I have the same issue with another project 🤣🤣🤣

@robinComa
Copy link
Author

webpack-node-externals to remove it from the webpack build

@jstoiko
Copy link
Contributor

jstoiko commented Jul 28, 2020

Thanks for the pointer @robinComa. Feel free to submit a PR.

@jstoiko jstoiko added the bug label Jul 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants