kaizensoze/node-github

Webpack: ENOENT: no such file or directory, open '//api/v3.0.0/routes.json'

Closed this issue · 3 comments

While the following is working fine in the node console :

var GitHubApi = require("github4");

var github = new GitHubApi({
    // required
    version: "3.0.0",
    // optional
    debug: true,
    protocol: "https",
    host: "github.my-GHE-enabled-company.com", // should be api.github.com for GitHub
    pathPrefix: "/api/v3", // for some GHEs; none for GitHub
    timeout: 5000,
    headers: {
        "user-agent": "My-Cool-GitHub-App" // GitHub is happy with a unique user agent
    }
});

in my webpack project I have the following error :

Uncaught Error: ENOENT: no such file or directory, open '//api/v3.0.0/routes.json'
  fs.openSync   @   fs.js:584
  module.(anonymous function)   @   ATOM_SHELL_ASAR.js:140
  fs.readFileSync   @   fs.js:431
  fs.readFileSync   @   ATOM_SHELL_ASAR.js:388
  module.exports    @   index.js?947d:184

This is because the file path in the node console is

/home/zedtux/Developments/grrn/node_modules/github4/api/v3.0.0/routes.json

and in the webpack project

//api/v3.0.0/routes.json

@kaizensoze ? Something happened fixing the issue ?

This ticket is technically out of date since a lot of the code has changed since then. If you're still seeing the issue, can you include a link to a small sample webpack project to help reproduce the issue?

Tahnk you @kaizensoze, sure I'll do it in case the issue remains