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

@ember-data/debug/data-adapter.js: Cannot read properties of undefined (reading 'env') #9461

Closed
Jopie01 opened this issue May 29, 2024 · 2 comments

Comments

@Jopie01
Copy link

Jopie01 commented May 29, 2024

I wanted to upgrade ember-data from 5.4.0-alpha.57 to 5.4.0-alpha.73 but walked into trouble. So I decided to see how far I could go in the releases and ended up with 5.4.0-alpha.64. Knowing from where to start I cloned the repo, linked it to my app and did a commit by commit test in my app and I ended up until PR #9292. After that commit I got the error:

Build Error (Babel) in @ember-data/debug/data-adapter.js

/home/user/ember/trytonstore/@ember-data/debug/data-adapter.js: Cannot read properties of undefined (reading 'env')TypeError: /home/user/ember/trytonstore/@ember-data/debug/data-adapter.js: Cannot read properties of undefined (reading 'env')

I suppose, because this is new way of building the packages, I have to make some changes as well in my app?
I'm using:

ember-source: 5.8.0
ember-cli: 5.8.0
@ember-data/debug: *
@ember-data/graph: *
@ember-data/json-api: *
@ember-data/request: *
@ember-data/store: *
@ember-data/tracking: *
@runspired
Copy link
Contributor

on current canary you need to install @warp-drive/build-config and setConfig within ember-cli-build (see test apps for examples). This is something we're working to find a way to avoid being a breaking change before shipping to stable, but the old style of config will be deprecated and this new style is going to be a required thing for apps to do.

@Jopie01
Copy link
Author

Jopie01 commented May 30, 2024

Thanks for explanation! I installed @warp-drive/build-config and changed the ember-cli-build.js and now everything is building successfully again. Now I have to dig through a lot of changes because of the changes in the Schema service.

FTR, I have installed the 5.4.0-alpha.73 versions of the different packages and changed the ember-cli-build.js as follows

module.exports = async function (defaults) {
  const { setConfig } = await import('@warp-drive/build-config');

  .....

  setConfig(app, __dirname, {
    compatWith: process.env.EMBER_DATA_FULL_COMPAT ? '99.0' : null,
  });

  ....

};

Mind the async and await.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants