Ember.js: fix export -- current error: @ember/object does not have a action export

Created on 13 Mar 2019  路  4Comments  路  Source: emberjs/ember.js

initially reported here: https://github.com/ember-cli/ember-octane-blueprint/issues/69

import { action } from '@ember/object';
@ember/object does not have a action export

experimental decorators feature flag is enabled :)

Most helpful comment

Annnnd, now the "real" import works.

Steps:

yarn upgrade ember-cli-babel@^7.6.0

Then you can use:

import { action } from '@ember/object';

All 4 comments

For anyone else playing around with Octane, the following hack works until the import is officially available:

const { action } = Ember.__loader.require('@ember/object');

@kpfefferle actually Ember._action is what you should use as a work around for now (no need to reach into the internal loader/registry that way)

Annnnd, now the "real" import works.

Steps:

yarn upgrade ember-cli-babel@^7.6.0

Then you can use:

import { action } from '@ember/object';

This is still an issue. Using ember-cli-babe 7.7.3.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chancancode picture chancancode  路  63Comments

ctataryn picture ctataryn  路  33Comments

alexander-alvarez picture alexander-alvarez  路  30Comments

GendelfLugansk picture GendelfLugansk  路  43Comments

Yelinz picture Yelinz  路  47Comments