auth0 / webtask-bundle

Module and CLI to bundle your code for use on https://webtask.io
28 stars 6 forks source link

Need to upgrade the babel config #27

Closed jrgleason closed 6 years ago

jrgleason commented 6 years ago

Originally submitted here..

when I try to bundle I get the following error...

looks like it is related to https://github.com/auth0/webtask-bundle/blob/master/lib/config.js. I think the property name needs changed.

Error: [BABEL] /Users/jackiegleason/Code/secondave-private/webtask/uPort/uportConnect.js: Invalid Option: useBuiltins is not a valid top-level option. Maybe you meant to use 'useBuiltIns'? (While processing: "/usr/local/lib/node_modules/wt-cli/node_modules/@babel/preset-env/lib/index.js") at validateTopLevelOptions (/usr/local/lib/node_modules/wt-cli/node_modules/@babel/preset-env/lib/normalize-options.js:47:13)

BrockBeaudry commented 6 years ago

Running into the same issue

jrgleason commented 6 years ago

I "almost" got it to work with my forks of webtask-runtime and webtask-bundle. Now I am just running into an issue with the module export... https://github.com/auth0/wt-cli/issues/215

jrgleason commented 6 years ago

My fork branches are... https://github.com/jrgleason/webtask-bundle/tree/27 https://github.com/jrgleason/webtask-runtime/tree/9

jrgleason commented 6 years ago

I got is to work using my forks make sure your .babelrc contains "presets": ["@babel/preset-env"]

If I don't have it and delete node_modules and package-lock.json I get..

Error: Cannot find module 'babel-preset-env' from '/Users/jackiegleason/Code/secondave-private/webtask/uPort'

  • Did you mean "@babel/env"?

But when I add it it works

jrgleason commented 6 years ago

I can confirm I still get the error on the current wt-cli though so webtask-bundle still needs the update.

dbertram commented 6 years ago

From what I can tell, wt-cli's --bundle option hasn't worked correctly since the webtask-bundle v3.0.1 release.

Using v3.1.0 will deploy, but all of my routes returned errors.

If you're using yarn you can work around this by setting wt-cli as a devDependency in your package.json and explicitly telling yarn to resolve its webtask-bundle dependency to v3.0.1:

{
  ...
  "devDependencies": {
    "wt-cli": "^9.5.0"
  },
  "resolutions": {
    "wt-cli/webtask-bundle": "3.0.1"
  }
}
NotMyself commented 6 years ago

@jrgleason @dbertram I am looking into this issue and will get back to you shortly.

ggoodman commented 6 years ago

@dbertram can you confirm whether or not this addresses your issues? If not, can you please describe the disk layout of your code vs the working directory when you are using --bundle?

dbertram commented 6 years ago

@ggoodman Using wt-cli@10.0.2 + webtask-bundle@3.2.2 the wt create --bundle appears to be working correctly again.

Thanks for digging into this!