Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

New preact project fails at dom render #245

Closed
2 of 4 tasks
quentin-sommer opened this issue Jan 25, 2017 · 3 comments
Closed
2 of 4 tasks

New preact project fails at dom render #245

quentin-sommer opened this issue Jan 25, 2017 · 3 comments
Labels

Comments

@quentin-sommer
Copy link

This issue is a:

  • Bug report
  • Feature request
  • Question / support request
  • Other

nwb is installed globally

node : 7.4.0
npm : 4.1.1
nwb: 0.15.2

node_molues --depth=0
├──[email protected]
├── [email protected]
└── [email protected]

When creating a react project nwb new react-app then installing then npm run start everything works fine. However with nwb new preact-app then installing then npm run start i get this error:

file : preact.js:143
Uncaught DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('[object Object]') is not a valid name.
    at createNode (http://localhost:3000/app.js:2680:171)
    at idiff (http://localhost:3000/app.js:2720:25)
    at diff (http://localhost:3000/app.js:2696:19)
    at render (http://localhost:3000/app.js:2948:16)
    at init (http://localhost:3000/app.js:4833:79)
    at Object../src/index.js (http://localhost:3000/app.js:4836:1)
    at __webpack_require__ (http://localhost:3000/app.js:660:30)
    at fn (http://localhost:3000/app.js:84:20)
    at Object.0 (http://localhost:3000/app.js:4868:18)
    at __webpack_require__ (http://localhost:3000/app.js:660:30)
@insin insin added the bug label Jan 25, 2017
@insin
Copy link
Owner

insin commented Jan 25, 2017

Looks like this is because we can no longer provide CommonJS interop when using ES modules in Webpack 2.

This change in index.js should fix it, will update the app skeleton template with it now:

 function init() {
-  let App = require('./App')
+  let App = require('./App').default
   root = render(<App/>, document.querySelector('#app'), root)
 }

@quentin-sommer
Copy link
Author

Perfect :)

@insin
Copy link
Owner

insin commented Jan 25, 2017

Fixed in v0.15.3 - thanks for the bug report!

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