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

Can't find "\index.jsx" from "./client" (code: ERR_ASSERTION) #5

Closed
laihaibo opened this issue Dec 19, 2017 · 5 comments
Closed

Can't find "\index.jsx" from "./client" (code: ERR_ASSERTION) #5

laihaibo opened this issue Dec 19, 2017 · 5 comments
Assignees
Labels

Comments

@laihaibo
Copy link

Hi, guys.
When I do a demo as your quick-start says just like (
$ npm install beidou-init -g $ beidou init $ npm install $ npm run start

), it show me a 500 error with these words (
Can't find \index.jsx from ....\beidou-demo/client (code: ERR_ASSERTION)
, but it has a index.jsx in client folder).
And I use Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:57.0) Gecko/20100101 Firefox/57.0.
So why do it exist?
Do I need to learn sth more about eggjs ?

@njugray
Copy link
Contributor

njugray commented Dec 19, 2017

@laihaibo
it seems to be an error path resolving on Windows, I am working on this and publish a hotfix version as soon as possible.
thanks for your feedback.

@njugray njugray assigned njugray and weichunpeng and unassigned njugray Dec 19, 2017
@laihaibo
Copy link
Author

laihaibo commented Dec 20, 2017

@njugray
it seems doesn‘t work。
console.log in PowerShell:
2017-12-20 21:20:00,717 WARN 12388 duplicateConfig error: ENOENT: no such file or directory, open 'C:\Users\laiha\Documents\node\beidou-demo\run\agent_Wed Dec 20 2017 21:20:00 GMT+0800 (中国标准时间)_config.json' Error: ENOENT: no such file or directory, open 'C:\Users\laiha\Documents\node\beidou-demo\run\agent_Wed Dec 20 2017 21:20:00 GMT+0800 (中国标准时间)_config.json' at Object.fs.openSync (fs.js:646:18) at Object.fs.writeFileSync (fs.js:1291:33) at BeidouAgent.dumpConfig (C:\Users\laiha\Documents\node\beidou-demo\node_modules\beidou-core\lib\core\agent\index.js:36:10) at process.nextTick (C:\Users\laiha\Documents\node\beidou-demo\node_modules\egg\lib\egg.js:59:50) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9)

2017-12-20 21:24:32,131 ERROR 4872 [-/::1/-/10ms GET /] nodejs.AssertionError [ERR_ASSERTION]: Can't find \index.jsx from C:\Users\laiha\Documents\node\beidou-demo/client at Map.resolve (C:\Users\laiha\Documents\node\beidou-demo\node_modules\egg-view\lib\view_manager.js:74:5) at resolve.next (<anonymous>) at onFulfilled (C:\Users\laiha\Documents\node\beidou-demo\node_modules\co\index.js:65:19) at <anonymous> generatedMessage: false name: 'AssertionError [ERR_ASSERTION]' code: 'ERR_ASSERTION' actual: undefined expected: true operator: '==' pid: 4872

When I open 'http://localhost:6001/' in browser, check the 'Show all frames':

  1. node_modules\egg-view\lib\view_manager.js:
    `
    let filename = this.fileMap.get(name);
    if (config.cache && filename) return filename;

    // try find it with default extension
    filename = yield resolvePath([ name, name + config.defaultExtension ], config.root);
    assert(filename, Can't find ${name} from ${config.root.join(',')});

    // set cache
    this.fileMap.set(name, filename);
    return filename;
    }
    `

  2. node_modules\co\index.js
    `
    */

    function onFulfilled(res) {
    var ret;
    try {
    ret = gen.next(res);
    } catch (e) {
    return reject(e);
    }
    next(ret);
    }
    `

@njugray
Copy link
Contributor

njugray commented Dec 21, 2017

@laihaibo upgrade pkg version and try again pls.

@njugray
Copy link
Contributor

njugray commented Dec 21, 2017

@laihaibo
Validated with PowerShell 6 on Window 10 x64.
image
Redux Example generated by beidou init and bootstrap with npm start

@laihaibo
Copy link
Author

@njugray
It works! Thank you for the hard work!

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

3 participants