opened
jefrydco
username_0
### Version

[v1.4.0](https://github.com/nuxt.js/releases/tag/v1.4.0)

### Reproduction link

[https://github.com/username_0/username_0-id](https://github.com/username_0/username_0-id)

### Steps to reproduce

I try to deploy nuxt project using the latest version of Nuxt which is `nuxt-edge` to firebase. This is my function code.

    const { Nuxt } = require('nuxt-edge')
    const express = require('express')
    const functions = require('firebase-functions')
    
    const app = express()
    
    const config = {
      dev: false,
      buildDir: 'nuxt',
      build: {
        extractCSS: true,
        cache: false,
        parallel: true,
        publicPath: '/assets/'
      }
    }
    
    const nuxt = new Nuxt(config)
    
    const handleRequest = (req, res) => {
      return new Promise((resolve, reject) => {
        nuxt.render(req, res, promise => {
          promise.then(resolve).catch(reject)
        })
      })
    }
    
    app.use(handleRequest)
    exports.username_0ssr = functions.https.onRequest(app)

It successfully run locally with `firebase serve --only hosting,function` command. But when I deployed it online and I open the hosting url, I got server error 500.

After I looked at the error log, I got error like this

    2018-06-14T12:43:26.094Z D username_0ssr: Code in file index.js can't be loaded.
    Is there a syntax error in your code?
    Detailed stack trace: Error: only one instance of babel-polyfill is allowed
        at Object.<anonymous> (/user_code/node_modules/nuxt-edge/node_modules/babel-polyfill/lib/index.js:10:9)
        at Module._compile (module.js:577:32)
        at Object.Module._extensions..js (module.js:586:10)
        at Module.load (module.js:494:32)
        at tryModuleLoad (module.js:453:12)
        at Function.Module._load (module.js:445:3)
        at Module.require (module.js:504:17)
        at require (internal/module.js:20:19)
        at Object.<anonymous> (/user_code/node_modules/nuxt-edge/dist/nuxt-legacy.js:50:1)
        at Module._compile (module.js:577:32)
        at Object.Module._extensions..js (module.js:586:10)
        at Module.load (module.js:494:32)
        at tryModuleLoad (module.js:453:12)
        at Function.Module._load (module.js:445:3)
        at Module.require (module.js:504:17)
        at require (internal/module.js:20:19)
    2018-06-14T12:43:26.206Z E username_0ssr: undefined
    2018-06-14T12:51:04.440Z N username_0ssr: undefined
    2018-06-14T12:53:28.052Z N username_0ssr: undefined

The repository of this project here https://github.com/username_0/username_0-id

### What is expected ?

Running the project using `firebase serve --only hosting,function` locally works perfectly.

### What is actually happening?

Deploying the project online get babel-polyfill error like I mentioned above.

<!--cmty--><!--cmty_prevent_hook-->
<div align="right"><sub><em>This bug report is available on <a href="https://cmty.app/nuxt">Nuxt</a> community (<a href="https://cmty.app/nuxt/nuxt.js/issues/c7247">#c7247</a>)</em></sub></div>
Deploying nuxt edge to firebase with function get babel-polyfill error
issue
created
usb248
username_1
Cloud Functions is Node v6.14.0.  [link]( https://cloud.google.com/functions/docs/writing/)
Minimum Node.js version required for Nuxt.js is also increased to 8.0.0 (Current LTS). [link](https://github.com/nuxt/nuxt.js/releases)
comment
created
ishitatsuyuki
username_2
https://cloud.google.com/functions/docs/concepts/nodejs-8-runtime
comment
created
manniL
username_3
With `nuxt-legacy` it should also work on Node 6 but as node 8 runtime is in beta now, problems are solved :clap: 

Please ping me if the error is still there. Closing here for now.
comment
closed
manniL
username_3
issue