question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

After upgrade to 2.0: ServerlessError: ReferenceError: index is not defined

See original GitHub issue

This is a:

  • [] Feature request or change
  • Bug report

For bug reports:

Expected behavior

Running serverless client deploy my static site should be deployed to S3ˀ

Actual behavior

After upgrade to 2.0 I get the following error when running SLS_DEBUG=true serverless client deploy:

ServerlessError: ReferenceError: index is not defined
    at _validateConfig.then.then.catch.error (/Users/warrick/dev/orchestrated/people-mapper-ui/node_modules/serverless-finch/index.js:223:33)
From previous event:
    at Client._processDeployment (/Users/warrick/dev/orchestrated/people-mapper-ui/node_modules/serverless-finch/index.js:222:13)
    at Object.client:deploy:deploy [as hook] (/Users/warrick/dev/orchestrated/people-mapper-ui/node_modules/serverless-finch/index.js:45:14)
    at BbPromise.reduce (/Users/warrick/dev/orchestrated/people-mapper-ui/node_modules/serverless/lib/classes/PluginManager.js:372:55)
From previous event:
    at PluginManager.invoke (/Users/warrick/dev/orchestrated/people-mapper-ui/node_modules/serverless/lib/classes/PluginManager.js:372:22)
    at PluginManager.run (/Users/warrick/dev/orchestrated/people-mapper-ui/node_modules/serverless/lib/classes/PluginManager.js:403:17)
    at variables.populateService.then (/Users/warrick/dev/orchestrated/people-mapper-ui/node_modules/serverless/lib/Serverless.js:102:33)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
From previous event:
    at Serverless.run (/Users/warrick/dev/orchestrated/people-mapper-ui/node_modules/serverless/lib/Serverless.js:89:74)
    at serverless.init.then (/Users/warrick/dev/orchestrated/people-mapper-ui/node_modules/serverless/bin/serverless:42:50)

Steps to reproduce

  1. Upgrade to 2.0
  2. include WebsiteConfiguration with IndexDocument or ErrorDocument or both
  3. run serverless client deploy
  • Operating system: Mac OSX

  • serverless-finch version: 2.0

  • serverless.yml that produces bug: Any serverless yml with WebsiteConfiguration IndexDocument and ErrorDocument will produce this error.

  • Command that produces bug: serverless client deploy

  • Other details: This error is reported immediately after an upgrade to serverless-finch 2.0. See lines 127 and 128 in index.js: indexDoc = this.options.indexDocument || index.html; errorDoc = this.options.errorDocument || error.html;

I think the default values should be explicit strings to fix this issue.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
fernando-mccommented, Apr 24, 2018

@wzedi I see you’ve put a PR in for this in #49 without me even having to ask! 😀 Thanks! This was indeed something we postponed so we could get out a v2 release with all the refactoring. I’m waiting for a merge from a collaborator and then will cut a new minor release to get this to you.

0reactions
wzedicommented, Apr 24, 2018

If it will stall is it possible to provide a CLI switch to disable prompts for automated deployments?

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReferenceError: index is not defined - javascript - Stack Overflow
I have to use a JS file in my TS project. This JS file was not made by me but I have to...
Read more >
Console throws "Require is not defined" err when loading sls ...
When my index.html tries to load the bundle with a tag, the browser's console logs the following error: lambda.js:4 Uncaught ReferenceError: ...
Read more >
'ReferenceError: contents is not defined' with U1db - Ask Ubuntu
Your problem is not with U1DB, but with the OptionSelector. Let's consider a simpler example: import QtQuick 2.0 import Ubuntu.
Read more >
NodeJs: ReferenceError: fetch is not defined - Brian Cline
NodeJs: ReferenceError: fetch is not defined ... To install it, I simply need to type the following command into the terminal.
Read more >
How to fix "Uncaught ReferenceError: x is not defined" in ...
JS Casts 04 - How to fix "Uncaught TypeError: x is not a function " in JavaScript.Visit https://javascriptcasts.com/episodes/04 for a summary ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found