sporto / elm-example-app

An example Elm single page application
436 stars 85 forks source link

Promise is not defined #22

Closed jimmack1963 closed 7 years ago

jimmack1963 commented 8 years ago

I am trying on windows 10, everything installed today so latest versions. Did have to also >npm install -g webpack-dev-server

I do end up with a non-responsive page titled 'Elm SPA example':


14:27:10 client.1   |     [74] (webpack)-dev-server/~/sockjs-client/lib/facade.js 723 bytes {0} [built]
14:27:10 client.1   |     [75] ./src/index.js 379 bytes {0} [built] [1 error]
14:27:10 client.1   |     [76] ./~/ace-css/css/ace.css 861 bytes {0} [built] [1 error]
14:27:10 client.1   |     [78] ./~/style-loader/addStyles.js 7.15 kB {0} [built]
14:27:10 client.1   |     [79] ./~/font-awesome/css/font-awesome.css 888 bytes {0} [built] [1 error]
14:27:10 client.1   |     [81] ./src/index.html 56 bytes {0} [built]
14:27:10 client.1   |  ERROR in ./src/Main.elm
14:27:10 client.1   |  Module build failed: TypeError: Object function Object() { [native code] } has no method 'assign'
14:27:10 client.1   |      at Object.getOptions (C:\dev\elm-tutorial-app\node_modules\elm-webpack-loader\index.js:20:17)
14:27:10 client.1   |      at Object.module.exports (C:\dev\elm-tutorial-app\node_modules\elm-webpack-loader\index.js:40:28)
14:27:10 client.1   |   @ ./src/index.js 9:10-31
14:27:10 client.1   |  ERROR in ./~/css-loader!./~/font-awesome/css/font-awesome.css
14:27:10 client.1   |  Module build failed: ReferenceError: Promise is not defined
14:27:10 client.1   |      at LazyResult.async (C:\dev\elm-tutorial-app\node_modules\css-loader\node_modules\postcss\lib\lazy-result.js:227:31)
14:27:10 client.1   |      at LazyResult.then (C:\dev\elm-tutorial-app\node_modules\css-loader\node_modules\postcss\lib\lazy-result.js:131:21)
14:27:10 client.1   |      at processCss (C:\dev\elm-tutorial-app\node_modules\css-loader\lib\processCss.js:198:5)
14:27:11 client.1   |      at Object.module.exports (C:\dev\elm-tutorial-app\node_modules\css-loader\lib\loader.js:24:2)
14:27:11 client.1   |   @ ./~/font-awesome/css/font-awesome.css 4:14-73
14:27:11 client.1   |  ERROR in ./~/css-loader!./~/ace-css/css/ace.css
14:27:11 client.1   |  Module build failed: ReferenceError: Promise is not defined
14:27:11 client.1   |      at LazyResult.async (C:\dev\elm-tutorial-app\node_modules\css-loader\node_modules\postcss\lib\lazy-result.js:227:31)
14:27:11 client.1   |      at LazyResult.then (C:\dev\elm-tutorial-app\node_modules\css-loader\node_modules\postcss\lib\lazy-result.js:131:21)
14:27:11 client.1   |      at processCss (C:\dev\elm-tutorial-app\node_modules\css-loader\lib\processCss.js:198:5)
14:27:11 client.1   |      at Object.module.exports (C:\dev\elm-tutorial-app\node_modules\css-loader\lib\loader.js:24:2)
14:27:11 client.1   |   @ ./~/ace-css/css/ace.css 4:14-64
14:27:11 client.1   |  webpack: bundle is now VALID.
sporto commented 8 years ago

Hi what version of Node are you using? I heard of people having issues with Node 7 in Windows.

jimmack1963 commented 8 years ago

Thanks, I'm on 6.9.1 where do you go to read things like that?

On Dec 2, 2016 5:17 PM, "Sebastian Porto" notifications@github.com wrote:

Hi what version of Node are you using. I heard of people having issues with Node 7 in Windows.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sporto/elm-tutorial-app/issues/22#issuecomment-264603892, or mute the thread https://github.com/notifications/unsubscribe-auth/AADlpjNOO1Fo16sFTraoU1cvFP4nBQdwks5rEMNCgaJpZM4LDE3l .

sporto commented 8 years ago

Someone else reported an issue with Windows and Node, but they were using Node 7.

sporto commented 8 years ago

I don't know why this would be happening in Node 6. But I can suggest

For the Module build failed: ReferenceError: Promise is not defined error Add https://github.com/stefanpenner/es6-promise

npm install es6-promise --save

Then Add to webpack.config.js near the top

require('es6-promise').polyfill();

Add for the TypeError: Object function Object() { [native code] } has no method 'assign' error

npm install object-assign --save

In webpack.config.js near the top

Object.assign = require('object-assign')
sporto commented 7 years ago

Closing as inactive