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

Creating an app with the default template throws an error #365

Closed
nephix opened this issue Sep 10, 2017 · 5 comments
Closed

Creating an app with the default template throws an error #365

nephix opened this issue Sep 10, 2017 · 5 comments

Comments

@nephix
Copy link

nephix commented Sep 10, 2017

When I build an app with the default template from https://github.com/developit/preact-cli/blob/master/src/resources/template.html I get an error message.

Do you want to request a feature or report a bug?
Bug

What is the current behavior?

Build failed!

Template execution failed: TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
  TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
  
  - template.html:15 module.exports
    [..]/[ejs-loader]/index.js!./template.html:15:25
  
  - index.js:264 
    [global]/[html-webpack-plugin]/index.js:264:16
  
  - util.js:16 tryCatcher
    [global]/[html-webpack-plugin]/[bluebird]/js/release/util.js:16:23
  
  - promise.js:512 Promise._settlePromiseFromHandler
    [global]/[html-webpack-plugin]/[bluebird]/js/release/promise.js:512:31
  
  - promise.js:569 Promise._settlePromise
    [global]/[html-webpack-plugin]/[bluebird]/js/release/promise.js:569:18
  
  - promise.js:606 Promise._settlePromiseCtx
    [global]/[html-webpack-plugin]/[bluebird]/js/release/promise.js:606:10
  
  - async.js:138 Async._drainQueue
    [global]/[html-webpack-plugin]/[bluebird]/js/release/async.js:138:12
  
  - async.js:143 Async._drainQueues
    [global]/[html-webpack-plugin]/[bluebird]/js/release/async.js:143:10
  
  - async.js:17 Immediate.Async.drainQueues
    [global]/[html-webpack-plugin]/[bluebird]/js/release/async.js:17:14

If the current behavior is a bug, please provide the steps to reproduce.

  1. preact create TestApp
  2. Copy content of https://github.com/developit/preact-cli/blob/master/src/resources/template.html into TestApp/src/template.html
  3. Run preact watch --template src/template.html or preact build.
    When I run npm run build the app builds successfully.

What is the expected behavior?
The app is built successfully with the default template. I can also add new header scripts to the template like e.g. Google Tag Manager.

Please mention other relevant information.

  • node version: 6.11.1
  • npm version: 5.3.0
  • Operating system: MacOS
  • preact-cli: 1.4.1
@lukeed
Copy link
Member

lukeed commented Sep 10, 2017

Are you using preact-cli v1.4.1?

@nephix
Copy link
Author

nephix commented Sep 10, 2017

Sorry I forgot about that, yes it's preact-cli 1.4.1

@nephix
Copy link
Author

nephix commented Sep 11, 2017

Any quick workaround for placing custom scripts into the <head>? This is currently blocking 4 production releases because we can't go live without Analytics.

By the way I'm getting the same error when I just run preact build as it uses the default template as well:

$ preact build
Build [==================  ] 91% (3.4s) additional asset processing
  Total precache size is about 831 kB for 42 resources.
Template execution failed: TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
  TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
  
  - template.html:89 DzK8.module.exports
    [global]/[preact-cli]/lib/resources/template.html:89:25
  
  - index.js:264 
    [global]/[html-webpack-plugin]/index.js:264:16
  
  - util.js:16 tryCatcher
    [global]/[html-webpack-plugin]/[bluebird]/js/release/util.js:16:23
  
  - promise.js:512 Promise._settlePromiseFromHandler
    [global]/[html-webpack-plugin]/[bluebird]/js/release/promise.js:512:31
  
  - promise.js:569 Promise._settlePromise
    [global]/[html-webpack-plugin]/[bluebird]/js/release/promise.js:569:18
  
  - promise.js:606 Promise._settlePromiseCtx
    [global]/[html-webpack-plugin]/[bluebird]/js/release/promise.js:606:10
  
  - async.js:138 Async._drainQueue
    [global]/[html-webpack-plugin]/[bluebird]/js/release/async.js:138:12
  
  - async.js:143 Async._drainQueues
    [global]/[html-webpack-plugin]/[bluebird]/js/release/async.js:143:10
  
  - async.js:17 Immediate.Async.drainQueues
    [global]/[html-webpack-plugin]/[bluebird]/js/release/async.js:17:14
  

Build failed!

@developit
Copy link
Member

Hi there! This seems like the same issue as #275, which ended up being an upstream issue: jantimon/html-webpack-plugin#753

@nephix
Copy link
Author

nephix commented Sep 14, 2017

We updated yarn to 1.0.2 and updated all globally installed packages now the mentioned preact-cli commands seem to work. Not sure what caused the issue. Another developer had the same problem but had it installed via npm and said running

$ npm uninstall -g preact-cli
$ npm install -g preact-cli

solved it on his machine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants