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 when building project with inferno aliases #4031

Open
gcfabri opened this Issue Mar 19, 2018 · 17 comments

Comments

6 participants
@gcfabri

gcfabri commented Mar 19, 2018

I am facing an error when running next build on my project with Inferno.JS.

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Build the project without errors.

Current Behavior

yarn run v1.5.1
$ next build
> Using external babel configuration
> Location: "/home/gcfabri/Workspace/fazanicrm/.babelrc"
> Failed to build
{ Error: (client) ./node_modules/inferno-compat/dist/index.mjs
Module not found: Error: Can't resolve 'inferno-clone-vnode' in '/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist'
resolve 'inferno-clone-vnode' in '/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist'
  Parsed request is a module
  using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/package.json (relative path: ./dist)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/package.json (relative path: ./dist)
    resolve as module
      looking for modules in /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules
        using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules)
          using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules/inferno-clone-vnode)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.js doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.jsx doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.json doesn't exist
            as directory
              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode doesn't exist
      /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist/node_modules doesn't exist or is not a directory
      /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/node_modules doesn't exist or is not a directory
      /home/gcfabri/Workspace/fazanicrm/node_modules/node_modules doesn't exist or is not a directory
      /home/gcfabri/Workspace/node_modules doesn't exist or is not a directory
      /home/gcfabri/node_modules doesn't exist or is not a directory
      /home/node_modules doesn't exist or is not a directory
      /node_modules doesn't exist or is not a directory
      looking for modules in /home/gcfabri/Workspace/fazanicrm/node_modules
        using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules)
          using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules/inferno-clone-vnode)
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.js doesn't exist
            .jsx
              Field 'browser' doesn't contain a valid alias configuration
              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.jsx doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.json doesn't exist
            as directory
              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode doesn't exist
[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode]
[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.js]
[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.jsx]
[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.json]
[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode]
[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist/node_modules]
[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/node_modules]
[/home/gcfabri/Workspace/fazanicrm/node_modules/node_modules]
[/home/gcfabri/Workspace/node_modules]
[/home/gcfabri/node_modules]
[/home/node_modules]
[/node_modules]
[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode]
[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.js]
[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.jsx]
[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.json]
[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode]
 @ ./node_modules/inferno-compat/dist/index.mjs 3:0-49 4:0-77
 @ ./node_modules/next/dist/client/index.js
 @ ./node_modules/next/dist/client/next.js
 @ multi ./node_modules/next/dist/client/next.js
    at /home/gcfabri/Workspace/fazanicrm/node_modules/next/dist/server/build/index.js:162:31
    at runWithDependencies (/home/gcfabri/Workspace/fazanicrm/node_modules/webpack/lib/MultiCompiler.js:154:4)
    at /home/gcfabri/Workspace/fazanicrm/node_modules/webpack/node_modules/async/dist/async.js:1126:9
    at /home/gcfabri/Workspace/fazanicrm/node_modules/webpack/node_modules/async/dist/async.js:473:16
    at iteratorCallback (/home/gcfabri/Workspace/fazanicrm/node_modules/webpack/node_modules/async/dist/async.js:1050:13)
    at /home/gcfabri/Workspace/fazanicrm/node_modules/webpack/node_modules/async/dist/async.js:958:16
    at /home/gcfabri/Workspace/fazanicrm/node_modules/webpack/node_modules/async/dist/async.js:1123:13
    at runCompilers (/home/gcfabri/Workspace/fazanicrm/node_modules/webpack/lib/MultiCompiler.js:96:47)
    at fn (/home/gcfabri/Workspace/fazanicrm/node_modules/webpack/lib/MultiCompiler.js:101:6)
    at compiler.run (/home/gcfabri/Workspace/fazanicrm/node_modules/webpack/lib/MultiCompiler.js:150:5)
    at emitRecords.err (/home/gcfabri/Workspace/fazanicrm/node_modules/webpack/lib/Compiler.js:265:13)
    at Compiler.emitRecords (/home/gcfabri/Workspace/fazanicrm/node_modules/webpack/lib/Compiler.js:371:38)
    at emitAssets.err (/home/gcfabri/Workspace/fazanicrm/node_modules/webpack/lib/Compiler.js:258:10)
    at applyPluginsAsyncSeries1.err (/home/gcfabri/Workspace/fazanicrm/node_modules/webpack/lib/Compiler.js:364:12)
    at next (/home/gcfabri/Workspace/fazanicrm/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/home/gcfabri/Workspace/fazanicrm/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
  errors: 
   [ '(client) ./node_modules/inferno-compat/dist/index.mjs\nModule not found: Error: Can\'t resolve \'inferno-clone-vnode\' in \'/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist\'\nresolve \'inferno-clone-vnode\' in \'/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist\'\n  Parsed request is a module\n  using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/package.json (relative path: ./dist)\n    Field \'browser\' doesn\'t contain a valid alias configuration\n  after using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/package.json (relative path: ./dist)\n    resolve as module\n      looking for modules in /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules\n        using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules)\n          Field \'browser\' doesn\'t contain a valid alias configuration\n        after using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules)\n          using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules/inferno-clone-vnode)\n            no extension\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode doesn\'t exist\n            .js\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.js doesn\'t exist\n            .jsx\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.jsx doesn\'t exist\n            .json\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.json doesn\'t exist\n            as directory\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode doesn\'t exist\n      /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/Workspace/fazanicrm/node_modules/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/Workspace/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/node_modules doesn\'t exist or is not a directory\n      /home/node_modules doesn\'t exist or is not a directory\n      /node_modules doesn\'t exist or is not a directory\n      looking for modules in /home/gcfabri/Workspace/fazanicrm/node_modules\n        using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules)\n          Field \'browser\' doesn\'t contain a valid alias configuration\n        after using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules)\n          using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules/inferno-clone-vnode)\n            no extension\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode doesn\'t exist\n            .js\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.js doesn\'t exist\n            .jsx\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.jsx doesn\'t exist\n            .json\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.json doesn\'t exist\n            as directory\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode doesn\'t exist\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.js]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.jsx]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode.json]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-clone-vnode]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist/node_modules]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/node_modules]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/node_modules]\n[/home/gcfabri/Workspace/node_modules]\n[/home/gcfabri/node_modules]\n[/home/node_modules]\n[/node_modules]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.js]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.jsx]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode.json]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-clone-vnode]\n @ ./node_modules/inferno-compat/dist/index.mjs 3:0-49 4:0-77\n @ ./node_modules/next/dist/client/index.js\n @ ./node_modules/next/dist/client/next.js\n @ multi ./node_modules/next/dist/client/next.js',
     '(client) ./node_modules/inferno-compat/dist/index.mjs\nModule not found: Error: Can\'t resolve \'inferno-create-class\' in \'/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist\'\nresolve \'inferno-create-class\' in \'/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist\'\n  Parsed request is a module\n  using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/package.json (relative path: ./dist)\n    Field \'browser\' doesn\'t contain a valid alias configuration\n  after using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/package.json (relative path: ./dist)\n    resolve as module\n      looking for modules in /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules\n        using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules)\n          Field \'browser\' doesn\'t contain a valid alias configuration\n        after using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules)\n          using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules/inferno-create-class)\n            no extension\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-class doesn\'t exist\n            .js\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-class.js doesn\'t exist\n            .jsx\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-class.jsx doesn\'t exist\n            .json\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-class.json doesn\'t exist\n            as directory\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-class doesn\'t exist\n      /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/Workspace/fazanicrm/node_modules/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/Workspace/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/node_modules doesn\'t exist or is not a directory\n      /home/node_modules doesn\'t exist or is not a directory\n      /node_modules doesn\'t exist or is not a directory\n      looking for modules in /home/gcfabri/Workspace/fazanicrm/node_modules\n        using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules)\n          Field \'browser\' doesn\'t contain a valid alias configuration\n        after using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules)\n          using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules/inferno-create-class)\n            no extension\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-class doesn\'t exist\n            .js\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-class.js doesn\'t exist\n            .jsx\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-class.jsx doesn\'t exist\n            .json\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-class.json doesn\'t exist\n            as directory\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-class doesn\'t exist\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-class]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-class.js]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-class.jsx]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-class.json]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-class]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist/node_modules]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/node_modules]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/node_modules]\n[/home/gcfabri/Workspace/node_modules]\n[/home/gcfabri/node_modules]\n[/home/node_modules]\n[/node_modules]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-class]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-class.js]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-class.jsx]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-class.json]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-class]\n @ ./node_modules/inferno-compat/dist/index.mjs 5:0-51 6:0-51\n @ ./node_modules/next/dist/client/index.js\n @ ./node_modules/next/dist/client/next.js\n @ multi ./node_modules/next/dist/client/next.js',
     '(client) ./node_modules/inferno-compat/dist/index.mjs\nModule not found: Error: Can\'t resolve \'inferno-create-element\' in \'/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist\'\nresolve \'inferno-create-element\' in \'/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist\'\n  Parsed request is a module\n  using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/package.json (relative path: ./dist)\n    Field \'browser\' doesn\'t contain a valid alias configuration\n  after using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/package.json (relative path: ./dist)\n    resolve as module\n      looking for modules in /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules\n        using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules)\n          Field \'browser\' doesn\'t contain a valid alias configuration\n        after using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules)\n          using description file: /home/gcfabri/Workspace/fazanicrm/node_modules/next/package.json (relative path: ./node_modules/inferno-create-element)\n            no extension\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-element doesn\'t exist\n            .js\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-element.js doesn\'t exist\n            .jsx\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-element.jsx doesn\'t exist\n            .json\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-element.json doesn\'t exist\n            as directory\n              /home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-element doesn\'t exist\n      /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/Workspace/fazanicrm/node_modules/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/Workspace/node_modules doesn\'t exist or is not a directory\n      /home/gcfabri/node_modules doesn\'t exist or is not a directory\n      /home/node_modules doesn\'t exist or is not a directory\n      /node_modules doesn\'t exist or is not a directory\n      looking for modules in /home/gcfabri/Workspace/fazanicrm/node_modules\n        using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules)\n          Field \'browser\' doesn\'t contain a valid alias configuration\n        after using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules)\n          using description file: /home/gcfabri/Workspace/fazanicrm/package.json (relative path: ./node_modules/inferno-create-element)\n            no extension\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-element doesn\'t exist\n            .js\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-element.js doesn\'t exist\n            .jsx\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-element.jsx doesn\'t exist\n            .json\n              Field \'browser\' doesn\'t contain a valid alias configuration\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-element.json doesn\'t exist\n            as directory\n              /home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-element doesn\'t exist\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-element]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-element.js]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-element.jsx]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-element.json]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/next/node_modules/inferno-create-element]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/dist/node_modules]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-compat/node_modules]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/node_modules]\n[/home/gcfabri/Workspace/node_modules]\n[/home/gcfabri/node_modules]\n[/home/node_modules]\n[/node_modules]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-element]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-element.js]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-element.jsx]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-element.json]\n[/home/gcfabri/Workspace/fazanicrm/node_modules/inferno-create-element]\n @ ./node_modules/inferno-compat/dist/index.mjs 7:0-55 8:0-55\n @ ./node_modules/next/dist/client/index.js\n @ ./node_modules/next/dist/client/next.js\n @ multi ./node_modules/next/dist/client/next.js' ],
  warnings: [] }
error An unexpected error occurred: "Command failed.
Exit code: 1
Command: sh
Arguments: -c next build
Directory: /home/gcfabri/Workspace/fazanicrm
Output:
".
info If you think this is a bug, please open a bug report with the information provided in "/home/gcfabri/Workspace/fazanicrm/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Steps to Reproduce (for bugs)

  1. next build

Context

I followed the examples concerning use of inferno, custom-server-express and apollo.

Your Environment

Tech Version
next 5.0.1-canary.15
node v9.5.0
OS elementary OS 0.4.1 Loki
inferno ^4.0.8
inferno-compat ^4.0.8
inferno-server ^4.0.8
react ^16.2.0
react-dom ^16.2.0
@gcfabri

This comment has been minimized.

Show comment
Hide comment
@gcfabri

gcfabri Mar 19, 2018

The error on building was solved running this: yarn add inferno-clone-vnode@latest inferno-create-class@latest inferno-create-element@latest. (Is this the correct approach?)

When running next build no errors are shown. But now I have another question: How can I build my custom-express-server to work with it?

This is my scripts in package.json:

"scripts": {
    "start": "NODE_ENV=production node build/dist/server/server.js",
    "dev": "nodemon -w server server/server.js --exec babel-node --presets env",
    "build": "next build && babel server -d build/dist/server",
    "lint": "eslint --fix components lib pages server **/*.js",
    "snyk": "snyk test"
  }

Once built, when running yarn start and trying to access my application in browser, it keeps on loading forever and the following error is shown in browser: This page isn’t working localhost didn’t send any data. ERR_EMPTY_RESPONSE.

Please, any help?

gcfabri commented Mar 19, 2018

The error on building was solved running this: yarn add inferno-clone-vnode@latest inferno-create-class@latest inferno-create-element@latest. (Is this the correct approach?)

When running next build no errors are shown. But now I have another question: How can I build my custom-express-server to work with it?

This is my scripts in package.json:

"scripts": {
    "start": "NODE_ENV=production node build/dist/server/server.js",
    "dev": "nodemon -w server server/server.js --exec babel-node --presets env",
    "build": "next build && babel server -d build/dist/server",
    "lint": "eslint --fix components lib pages server **/*.js",
    "snyk": "snyk test"
  }

Once built, when running yarn start and trying to access my application in browser, it keeps on loading forever and the following error is shown in browser: This page isn’t working localhost didn’t send any data. ERR_EMPTY_RESPONSE.

Please, any help?

@jhohlfeld

This comment has been minimized.

Show comment
Hide comment
@jhohlfeld

jhohlfeld Mar 23, 2018

Hey,

I'm experiencing this very same issue with react-styled-flexboxgrid.

I am using next with a babel plugin to resolve modules from ./src as pseudo-global module. This works perfectly fine with all my own modules in ./src, however, it seems to be trashing withreact-styled-flexboxgrid.

When building/running locally btw, it works perfectly fine. It's only on now that this issue keeps coming up.

Console output:

$ now
> Deploying *****
> Using Node.js 8.10.0 (default)
> Ready! ***** (copied to clipboard) [8s]
> Synced 1 file (302B) [8s]
> Initializing…
> Building
> ▲ npm install
> ✓ Using "package-lock.json"
> ⧗ Installing 27 main dependencies…
> ✓ Installed 1789 modules [1m]
> ▲ npm run build
> Using external babel configuration
> { Error: ./src/components/pages/Homepage.js
> Module not found: Error: Can't resolve 'react-styled-flexboxgrid' in '/home/nowuser/src/src/components/pages'
...
>               Field 'browser' doesn't contain a valid alias configuration
>               /home/nowuser/src/node_modules/react-styled-flexboxgrid doesn't exist
...

From reading here, it seems this message is coming from webpack and means the module resolution is not working as intended.

I am using babel-plugin-module-resolver to resolve everything in ./src as a "global" module:

import Homepage from "pages/Homepage";

instead of

import Homepage from "../../going-all-over-the-place/../components/pages/Homepage";

I event tried providing a webpack config in next.config.js to maybe help now/next, wich made matters even worse.

Any ideas?

jhohlfeld commented Mar 23, 2018

Hey,

I'm experiencing this very same issue with react-styled-flexboxgrid.

I am using next with a babel plugin to resolve modules from ./src as pseudo-global module. This works perfectly fine with all my own modules in ./src, however, it seems to be trashing withreact-styled-flexboxgrid.

When building/running locally btw, it works perfectly fine. It's only on now that this issue keeps coming up.

Console output:

$ now
> Deploying *****
> Using Node.js 8.10.0 (default)
> Ready! ***** (copied to clipboard) [8s]
> Synced 1 file (302B) [8s]
> Initializing…
> Building
> ▲ npm install
> ✓ Using "package-lock.json"
> ⧗ Installing 27 main dependencies…
> ✓ Installed 1789 modules [1m]
> ▲ npm run build
> Using external babel configuration
> { Error: ./src/components/pages/Homepage.js
> Module not found: Error: Can't resolve 'react-styled-flexboxgrid' in '/home/nowuser/src/src/components/pages'
...
>               Field 'browser' doesn't contain a valid alias configuration
>               /home/nowuser/src/node_modules/react-styled-flexboxgrid doesn't exist
...

From reading here, it seems this message is coming from webpack and means the module resolution is not working as intended.

I am using babel-plugin-module-resolver to resolve everything in ./src as a "global" module:

import Homepage from "pages/Homepage";

instead of

import Homepage from "../../going-all-over-the-place/../components/pages/Homepage";

I event tried providing a webpack config in next.config.js to maybe help now/next, wich made matters even worse.

Any ideas?

@jhohlfeld

This comment has been minimized.

Show comment
Hide comment
@jhohlfeld

jhohlfeld Mar 23, 2018

Small update

I was able to reproduce this issue locally. After installing $ npm install -g next and using next as the build runner ($ next build), the same error occurred on my machine, too.

Before that, I was using $ yarn build with a mapping in package.json:

  "scripts": {
    "build": "next build",
    "start": "next start"
  }

🤔 very interesting. It seems, now/next is running the module resolution differently from yarn..

jhohlfeld commented Mar 23, 2018

Small update

I was able to reproduce this issue locally. After installing $ npm install -g next and using next as the build runner ($ next build), the same error occurred on my machine, too.

Before that, I was using $ yarn build with a mapping in package.json:

  "scripts": {
    "build": "next build",
    "start": "next start"
  }

🤔 very interesting. It seems, now/next is running the module resolution differently from yarn..

@jhohlfeld

This comment has been minimized.

Show comment
Hide comment
@jhohlfeld

jhohlfeld Mar 23, 2018

Okay now. I dumped the whole resolve.module thing and refactored my code to always look for modules with relative paths and now it's working. Maybe this will help others.

jhohlfeld commented Mar 23, 2018

Okay now. I dumped the whole resolve.module thing and refactored my code to always look for modules with relative paths and now it's working. Maybe this will help others.

@kolpav

This comment has been minimized.

Show comment
Hide comment
@kolpav

kolpav Mar 25, 2018

@jhohlfeld I am also using babel-plugin-module-resolver my local build works fine but on my build server it is crashing with same error message. I have tried a lot of things but same error messages appear Can't resolve ... in ... and Field 'browser' doesn't contain a valid alias configuration. The "Can't resolve..." message doesn't seem to be caused by one specific package. I am having hard time figuring out what is the problem as I am unable to reproduce on my local machine.

kolpav commented Mar 25, 2018

@jhohlfeld I am also using babel-plugin-module-resolver my local build works fine but on my build server it is crashing with same error message. I have tried a lot of things but same error messages appear Can't resolve ... in ... and Field 'browser' doesn't contain a valid alias configuration. The "Can't resolve..." message doesn't seem to be caused by one specific package. I am having hard time figuring out what is the problem as I am unable to reproduce on my local machine.

@kolpav

This comment has been minimized.

Show comment
Hide comment
@kolpav

kolpav Mar 27, 2018

I take my words back it had nothing to do with next I had wrong import because I renamed file which changed only in case and forgot to use git mv so my remote had lowercase file but on my local it was camelCased that explains why it was building on my local and not on my build server.

kolpav commented Mar 27, 2018

I take my words back it had nothing to do with next I had wrong import because I renamed file which changed only in case and forgot to use git mv so my remote had lowercase file but on my local it was camelCased that explains why it was building on my local and not on my build server.

@gpolyn

This comment has been minimized.

Show comment
Hide comment
@gpolyn

gpolyn May 15, 2018

Similar/same issue (at http://www.oddjack.com/?certs=gpolyn/nextjs-google-map-react/tree/inferno)...

$ npm run build
> nextjs-google-map-react@1.0.0 build /Users/blah/code/projects/q12018/next/nextjs-google-map-react
> next build

> Failed to build
{ Error: (client) ./node_modules/inferno-compat/dist/index.esm.js
Module not found: Error: Can't resolve 'inferno-create-class' in '/Users/blah/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-compat/dist'
resolve 'inferno-create-class' in '/Users/blah/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-compat/dist'
  Parsed request is a module
  using description file: /Users/blah/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-compat/package.json (relative path: ./dist)
    Field 'browser' doesn't contain a valid alias configuration
[...]
Tech Version
next 6.0.2
node v8.9.4
OS OSX
inferno 5.0.5
inferno-compat 5.0.5
inferno-server 5.0.5
react 16.3.2
react-dom 16.3.2

gpolyn commented May 15, 2018

Similar/same issue (at http://www.oddjack.com/?certs=gpolyn/nextjs-google-map-react/tree/inferno)...

$ npm run build
> nextjs-google-map-react@1.0.0 build /Users/blah/code/projects/q12018/next/nextjs-google-map-react
> next build

> Failed to build
{ Error: (client) ./node_modules/inferno-compat/dist/index.esm.js
Module not found: Error: Can't resolve 'inferno-create-class' in '/Users/blah/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-compat/dist'
resolve 'inferno-create-class' in '/Users/blah/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-compat/dist'
  Parsed request is a module
  using description file: /Users/blah/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-compat/package.json (relative path: ./dist)
    Field 'browser' doesn't contain a valid alias configuration
[...]
Tech Version
next 6.0.2
node v8.9.4
OS OSX
inferno 5.0.5
inferno-compat 5.0.5
inferno-server 5.0.5
react 16.3.2
react-dom 16.3.2
@gcfabri

This comment has been minimized.

Show comment
Hide comment
@gcfabri

gcfabri May 18, 2018

@gpolyn yarn add inferno inferno-compat inferno-clone-vnode inferno-create-class inferno-create-element This should solve your problem.

gcfabri commented May 18, 2018

@gpolyn yarn add inferno inferno-compat inferno-clone-vnode inferno-create-class inferno-create-element This should solve your problem.

gpolyn added a commit to gpolyn/nextjs-google-map-react that referenced this issue May 18, 2018

@gpolyn

This comment has been minimized.

Show comment
Hide comment
@gpolyn

gpolyn May 18, 2018

@gcfabri thanks!

Made your suggested changes (shown in full farther below) and it succeeds in dev (next), but fails after build step and served via NODE_ENV=production node server.js.

Error: Inferno Error: createElement() name parameter cannot be undefined, null, false or true, It must be a string, class or function.
    at Object.c [as createElement] (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-create-element/dist/index.cjs.min.js:1:700)
    at Container.render (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/next/dist/lib/app.js:188:29)
    at T (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-server/dist/index.cjs.min.js:1:1890)
    at T (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-server/dist/index.cjs.min.js:1:1967)
    at k (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-server/dist/index.cjs.min.js:1:2894)
    at renderPage (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/next/dist/server/render.js:275:26)
    at Function.getInitialProps (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/next/dist/server/document.js:67:25)
    at _callee$ (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/next/dist/lib/utils.js:111:30)
    at tryCatch (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/regenerator-runtime/runtime.js:296:22)

http://www.oddjack.com/?certs=gpolyn/nextjs-google-map-react/tree/inferno...

Tech Version
next 6.0.2
node v8.9.4
OS OSX
inferno 5.0.5
inferno-compat 5.0.5
inferno-server 5.0.5
react 16.3.2
react-dom 16.3.2
inferno-clone-vnode 5.0.5
inferno-create-class 5.0.6
inferno-create-element 5.0.6
module-alias 2.0.6

gpolyn commented May 18, 2018

@gcfabri thanks!

Made your suggested changes (shown in full farther below) and it succeeds in dev (next), but fails after build step and served via NODE_ENV=production node server.js.

Error: Inferno Error: createElement() name parameter cannot be undefined, null, false or true, It must be a string, class or function.
    at Object.c [as createElement] (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-create-element/dist/index.cjs.min.js:1:700)
    at Container.render (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/next/dist/lib/app.js:188:29)
    at T (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-server/dist/index.cjs.min.js:1:1890)
    at T (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-server/dist/index.cjs.min.js:1:1967)
    at k (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/inferno-server/dist/index.cjs.min.js:1:2894)
    at renderPage (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/next/dist/server/render.js:275:26)
    at Function.getInitialProps (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/next/dist/server/document.js:67:25)
    at _callee$ (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/next/dist/lib/utils.js:111:30)
    at tryCatch (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/gp/code/projects/q12018/next/nextjs-google-map-react/node_modules/regenerator-runtime/runtime.js:296:22)

http://www.oddjack.com/?certs=gpolyn/nextjs-google-map-react/tree/inferno...

Tech Version
next 6.0.2
node v8.9.4
OS OSX
inferno 5.0.5
inferno-compat 5.0.5
inferno-server 5.0.5
react 16.3.2
react-dom 16.3.2
inferno-clone-vnode 5.0.5
inferno-create-class 5.0.6
inferno-create-element 5.0.6
module-alias 2.0.6
@gcfabri

This comment has been minimized.

Show comment
Hide comment
@gcfabri

gcfabri May 30, 2018

Yes @gpolyn , the issue is the same when trying to build and run the examples/using-inferno. Anyone found the solution for this? @timneutkens Could you help us?

gcfabri commented May 30, 2018

Yes @gpolyn , the issue is the same when trying to build and run the examples/using-inferno. Anyone found the solution for this? @timneutkens Could you help us?

@timneutkens

This comment has been minimized.

Show comment
Hide comment
@timneutkens

timneutkens May 30, 2018

Collaborator

Maybe @fouad knows what's going on

Collaborator

timneutkens commented May 30, 2018

Maybe @fouad knows what's going on

@AndyOGo

This comment has been minimized.

Show comment
Hide comment
@AndyOGo

AndyOGo Jun 27, 2018

I have the same error as @gpolyn 😞

AndyOGo commented Jun 27, 2018

I have the same error as @gpolyn 😞

@AndyOGo

This comment has been minimized.

Show comment
Hide comment
@AndyOGo

AndyOGo Jun 27, 2018

So inferno-create-element is checking for valid types here:
http://www.oddjack.com/?certs=infernojs/inferno/blob/master/packages/inferno-create-element/src/index.ts#L26-L28

So I logged the value of type:

{ [Function: App]
  displayName: 'App',
  childContextTypes:
   { _containerProps: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     headManager: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     router: { [Function: bound checkType] isRequired: [Function: bound checkType] } } }
[Function]
{ [Function: Container]
  contextTypes: { _containerProps: { [Function: bound checkType] isRequired: [Function: bound checkType] } } }
undefined
meta
{ Error: Inferno Error: createElement() name parameter cannot be undefined, null, false or true, It must be a string, class or function.
    at Object.createElement (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-create-element/dist/index.cjs.js:53:15)
    at Container.render (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/lib/app.js:188:29)
    at renderVNodeToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:184:41)
    at renderVNodeToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:195:20)
    at renderToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:308:12)
    at renderPage (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/server/render.js:277:26)
    at Function.getInitialProps (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/server/document.js:67:25)
    at _callee$ (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/lib/utils.js:111:30)
    at tryCatch (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:62:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:296:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:12:30)
    at _next (/Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:9)
    at /Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:34:7
    at Promise.F (/Users/andy/scale-unlimited/webapp_v2/node_modules/core-js/library/modules/_export.js:36:28)
    at /Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:7:12 sourceMapsApplied: true }

AndyOGo commented Jun 27, 2018

So inferno-create-element is checking for valid types here:
http://www.oddjack.com/?certs=infernojs/inferno/blob/master/packages/inferno-create-element/src/index.ts#L26-L28

So I logged the value of type:

{ [Function: App]
  displayName: 'App',
  childContextTypes:
   { _containerProps: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     headManager: { [Function: bound checkType] isRequired: [Function: bound checkType] },
     router: { [Function: bound checkType] isRequired: [Function: bound checkType] } } }
[Function]
{ [Function: Container]
  contextTypes: { _containerProps: { [Function: bound checkType] isRequired: [Function: bound checkType] } } }
undefined
meta
{ Error: Inferno Error: createElement() name parameter cannot be undefined, null, false or true, It must be a string, class or function.
    at Object.createElement (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-create-element/dist/index.cjs.js:53:15)
    at Container.render (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/lib/app.js:188:29)
    at renderVNodeToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:184:41)
    at renderVNodeToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:195:20)
    at renderToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:308:12)
    at renderPage (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/server/render.js:277:26)
    at Function.getInitialProps (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/server/document.js:67:25)
    at _callee$ (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/lib/utils.js:111:30)
    at tryCatch (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:62:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:296:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:12:30)
    at _next (/Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:9)
    at /Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:34:7
    at Promise.F (/Users/andy/scale-unlimited/webapp_v2/node_modules/core-js/library/modules/_export.js:36:28)
    at /Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:7:12 sourceMapsApplied: true }
@AndyOGo

This comment has been minimized.

Show comment
Hide comment
@AndyOGo

AndyOGo Jun 27, 2018

@gcfabri
@gpolyn
@timneutkens
@fouad
guys I tracked it down.

The lib/app.js files Container use the short Syntax for React.Fragment in it's render method.

render () {
    const {children} = this.props
    return <>{children}</>
}

And Inferno does not support fragments yet.

Log:

App render Container: function Container() {
    (0, _classCallCheck2.default)(this, Container);
    return (0, _possibleConstructorReturn2.default)(this, (Container.__proto__ || (0, _getPrototypeOf.default)(Container)).apply(this, arguments));
  }
App render: Component function () {
  return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", {
    __source: {
      fileName: _jsxFileName,
      lineNumber: 1
    }
  }, "Welcome to next.js!");
}
Container render Fragment: undefined
>>> createElement undefined
{ Error: Inferno Error: createElement() name parameter cannot be undefined, null, false or true, It must be a string, class or function.
    at Object.createElement (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-create-element/dist/index.cjs.js:53:15)
    at Container.render (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/lib/app.js:195:29)
    at renderVNodeToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:184:41)
    at renderVNodeToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:195:20)
    at renderToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:308:12)
    at renderPage (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/server/render.js:277:26)
    at Function.getInitialProps (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/server/document.js:67:25)
    at _callee$ (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/lib/utils.js:111:30)
    at tryCatch (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:62:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:296:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:12:30)
    at _next (/Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:9)
    at /Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:34:7
    at Promise.F (/Users/andy/scale-unlimited/webapp_v2/node_modules/core-js/library/modules/_export.js:36:28)
    at /Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:7:12 sourceMapsApplied: true }

AndyOGo commented Jun 27, 2018

@gcfabri
@gpolyn
@timneutkens
@fouad
guys I tracked it down.

The lib/app.js files Container use the short Syntax for React.Fragment in it's render method.

render () {
    const {children} = this.props
    return <>{children}</>
}

And Inferno does not support fragments yet.

Log:

App render Container: function Container() {
    (0, _classCallCheck2.default)(this, Container);
    return (0, _possibleConstructorReturn2.default)(this, (Container.__proto__ || (0, _getPrototypeOf.default)(Container)).apply(this, arguments));
  }
App render: Component function () {
  return __WEBPACK_IMPORTED_MODULE_0_react___default.a.createElement("div", {
    __source: {
      fileName: _jsxFileName,
      lineNumber: 1
    }
  }, "Welcome to next.js!");
}
Container render Fragment: undefined
>>> createElement undefined
{ Error: Inferno Error: createElement() name parameter cannot be undefined, null, false or true, It must be a string, class or function.
    at Object.createElement (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-create-element/dist/index.cjs.js:53:15)
    at Container.render (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/lib/app.js:195:29)
    at renderVNodeToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:184:41)
    at renderVNodeToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:195:20)
    at renderToString (/Users/andy/scale-unlimited/webapp_v2/node_modules/inferno-server/dist/index.cjs.js:308:12)
    at renderPage (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/server/render.js:277:26)
    at Function.getInitialProps (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/server/document.js:67:25)
    at _callee$ (/Users/andy/scale-unlimited/webapp_v2/node_modules/next/dist/lib/utils.js:111:30)
    at tryCatch (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:62:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:296:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/Users/andy/scale-unlimited/webapp_v2/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:12:30)
    at _next (/Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:27:9)
    at /Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:34:7
    at Promise.F (/Users/andy/scale-unlimited/webapp_v2/node_modules/core-js/library/modules/_export.js:36:28)
    at /Users/andy/scale-unlimited/webapp_v2/node_modules/@babel/runtime/helpers/asyncToGenerator.js:7:12 sourceMapsApplied: true }
@AndyOGo

This comment has been minimized.

Show comment
Hide comment
@AndyOGo

AndyOGo Jun 27, 2018

I just filed a PR:
#4682

AndyOGo commented Jun 27, 2018

I just filed a PR:
#4682

@AndyOGo

This comment has been minimized.

Show comment
Hide comment
@AndyOGo

AndyOGo Jun 27, 2018

@gcfabri
@gpolyn
@timneutkens
@fouad
Intermediate quickfix is to override app.js, like:

pages/_app.js

import App, { Container, createUrl } from 'next/app'
import React from 'react'

class MyContainer extends Container {
  render () {
    const {children} = this.props

    // make sure to support all React-like libraries, whether they support Arrays, React.Fragment or not
    if (Array.isArray(children)) {
      console.log('Children is an array');

      // a root node is necessary
      return <div>{children.map((child, index) => {
        // only set key if it's null or undefined
        if (child.key == null) {
          child.key = index
        }

        console.log(`${child.key} -> ${index}`)

        return child
      })}</div>
    }

    return children
  }
}

export default class MyApp extends App {
  render () {
    const {router, Component, pageProps} = this.props
    const url = createUrl(router)
    return <MyContainer>
      <Component {...pageProps} url={url} />
    </MyContainer>
  }
}

AndyOGo commented Jun 27, 2018

@gcfabri
@gpolyn
@timneutkens
@fouad
Intermediate quickfix is to override app.js, like:

pages/_app.js

import App, { Container, createUrl } from 'next/app'
import React from 'react'

class MyContainer extends Container {
  render () {
    const {children} = this.props

    // make sure to support all React-like libraries, whether they support Arrays, React.Fragment or not
    if (Array.isArray(children)) {
      console.log('Children is an array');

      // a root node is necessary
      return <div>{children.map((child, index) => {
        // only set key if it's null or undefined
        if (child.key == null) {
          child.key = index
        }

        console.log(`${child.key} -> ${index}`)

        return child
      })}</div>
    }

    return children
  }
}

export default class MyApp extends App {
  render () {
    const {router, Component, pageProps} = this.props
    const url = createUrl(router)
    return <MyContainer>
      <Component {...pageProps} url={url} />
    </MyContainer>
  }
}
@AndyOGo

This comment has been minimized.

Show comment
Hide comment
@AndyOGo

AndyOGo Jun 28, 2018

I just updated above quickfix, in case you have multiple children, you need a root node

AndyOGo commented Jun 28, 2018

I just updated above quickfix, in case you have multiple children, you need a root node

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment