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

@formatjs is not working with fast boot #791

Open
gedaiu opened this issue Sep 19, 2020 · 2 comments
Open

@formatjs is not working with fast boot #791

gedaiu opened this issue Sep 19, 2020 · 2 comments

Comments

@gedaiu
Copy link

gedaiu commented Sep 19, 2020

It looks like fat boot it is not working with the latest @formatjs poyfills. Is there a workaroun this? everything works fine if I don't run fastboot.

ember-cli-build.js

...
babel: {
      plugins: [ require.resolve('ember-auto-import/babel-plugin'), "transform-optional-chaining" ]
    }
...

App is being served by FastBoot
/tmp/broccoli-130391zwtRy0DpAwx/out-618-append_ember_auto_import_analyzer/assets/vendor.js:141913
      return formatterInstance.format(value, formatOptions?.unit ?? formatterOptions.unit);
                                                           ^

SyntaxError: Unexpected token '.'
    at new Script (vm.js:88:7)
    at VMSandbox.eval (/home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/fastboot/src/vm-sandbox.js:13:22)
    at /home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/fastboot/src/ember-app.js:190:15
    at Array.forEach (<anonymous>)
    at EmberApp.loadAppFiles (/home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/fastboot/src/ember-app.js:187:21)
    at EmberApp.retrieveSandboxedApp (/home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/fastboot/src/ember-app.js:235:10)
    at new EmberApp (/home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/fastboot/src/ember-app.js:61:21)
    at FastBoot._buildEmberApp (/home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/fastboot/src/index.js:114:17)
    at new FastBoot (/home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/fastboot/src/index.js:52:10)
    at /home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/ember-cli-fastboot/index.js:335:29
    at Layer.handle [as handle_request] (/home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/express/lib/router/index.js:317:13)
    at /home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/express/lib/router/index.js:335:12)
    at next (/home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/express/lib/router/index.js:275:10)
    at /home/gedaiu/workspace/gis-collective/frontend/web-frontend/node_modules/ember-cli/lib/tasks/server/middleware/broccoli-watcher/index.js:54:11
@SergeAstapov
Copy link
Contributor

@gedaiu please follow #764 (comment) for a solution (TL;DR add node: current to config/targets.js).

Upstream fix is part of latest v3 beta, see #770 for details

@mansona
Copy link
Member

mansona commented Sep 22, 2020

@SergeAstapov the upstream fix will only apply in the case that you install ember-cli-fastboot using ember install. It uses the default blueprint to apply node: current to your targets file.

There will be a follow-on feature where we will error if there is not node version defined in your targets file so the issue will be crystal clear to end-users that the need to add it 👍

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