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

Incompatible with Ember 5.0.0 #2577

Closed
Elawphant opened this issue Jun 26, 2023 · 19 comments
Closed

Incompatible with Ember 5.0.0 #2577

Elawphant opened this issue Jun 26, 2023 · 19 comments

Comments

@Elawphant
Copy link

Ember-simple-auth 5.0.0 is incompatible with ember-cli 5.0.0
it requires ember source 3.8 || 4, while ember-cli 5's ember-source is ~5.0.0
If we npm install ember-simple-auth --force it will install it, but the browser will raise missing imports errors. e.g. Could not find module @ember/polyfills imported from ember-simple-auth/utils/assign.

@BobrImperator
Copy link
Collaborator

Please use 6.0.0-rc.1 version.
It should be fairly safe to use and soon we'll do an official 6.0.0 release.
I don't expect any library changes between the release candidate and 6.0.0 either.

@BobrImperator
Copy link
Collaborator

BobrImperator commented Jun 26, 2023

@Elawphant
Copy link
Author

I can confirm that 6.0.0-rc.1 works fine. Looking forward to the release.

@bracke
Copy link

bracke commented Jul 5, 2023

I'm getting "Could not find module ember-simple-auth/services/session imported from (require)" when using "6.0.0-rc.1".

This is with Ember 5 and embroider.

@BobrImperator
Copy link
Collaborator

BobrImperator commented Jul 5, 2023

Hi @bracke
Are you using Torii by any chance?

We've had failing embroider + ember-source 5 scenarios when torii is present. See #2559

@bracke
Copy link

bracke commented Jul 5, 2023

@BobrImperator No, not in this project.
Anything I can do to locate the cause?

@BobrImperator
Copy link
Collaborator

@bracke It's a tricky issue.
Usually I'd find it to be a mixture of outdated addons and ember's build dependencies ember-cli-babel, ember-auto-import, ember-resolver.

However it could also be some issue with ESA not being an actual V2 addon.
I'll try to give it a shot later this week and setup a reproduction.

@bracke
Copy link

bracke commented Jul 5, 2023

@BobrImperator the error happens in our session service when importing the basesessionservice, are we doing anything wrong?

import { service } from '@ember/service';
import BaseSessionService from 'ember-simple-auth/services/session';

export default class SessionService extends BaseSessionService {
  @service currentUser;
  @service router;

  async handleAuthentication() {
    super.handleAuthentication(...arguments);

    try {
      await this.currentUser.load();
    } catch (err) {
      await this.invalidate();
    }
  }
}

@BobrImperator
Copy link
Collaborator

Thanks for the snippet.
It looks OK.

@bracke
Copy link

bracke commented Jul 5, 2023

@BobrImperator
I have now tried to run our tests and there I get the same problem:

Could not find module ember-simple-auth/test-supportimported from(require)``

So the problem is really a general inability to access the 'ember-simple-auth' namespace/folder.

@bracke
Copy link

bracke commented Jul 14, 2023

Hi @BobrImperator

Did you get any further? Any idea how we can resolve this?

@BobrImperator
Copy link
Collaborator

BobrImperator commented Jul 14, 2023

It's very likely it's happening because ESA is still a V1 addon and V1 addons can't be statically analyzed.

WIP #2604

@bracke
Copy link

bracke commented Jul 18, 2023

I have tried to use the "v2-addon" branch, but it does not seem to make any difference.
I still get "Could not find module ember-simple-auth/services/session imported from (require)".

@BobrImperator
Copy link
Collaborator

BobrImperator commented Jul 18, 2023

The branch might not be functioning properly yet.

Also I've seen on some threads that a lot of folks are downgrading their @embroider deps to 3.0.0 because the current latest 3.1 introduced something that caused breakage:

             "@embroider/core": "~3.0.0",
              "@embroider/compat": "~3.0.0",
              "@embroider/webpack": "~3.0.0",

Like Nullvox proposed to do here https://github.com/mainmatter/ember-simple-auth/pull/2606/files#diff-c88af450d41d3281997faafe7ac13e280ae5840c6b81f68cc395c2a20d7e4830R154
Which didn't actually fix all of our CI but did fix embroider-safe and embroider-optimized scenarios for the addon itself.

Both the downgrade and using the specific branch could be worth a shot. If you could try that then that'd help us a lot 👍

Also I'm not sure how installing through git works anymore with the rollup, so please make sure to clone the repo, check out the branch, compile the dist and link ember-simple-auth from your file system.

@bracke
Copy link

bracke commented Jul 18, 2023

Still does not seem to change anything.
I have tried all the things you mention.
Note: This is with Ember 5.1.2. and with embroider fully activated.

billede

@RobbieTheWagner
Copy link
Contributor

I'm getting ember-cookies errors myself

Build Error (PackagerRunner) in services/cookies.js

Module not found: Error: Can't resolve '/Users/rwwagner90/shipshape/swach/node_modules/.pnpm/ember-cookies@1.0.0/node_modules/ember-cookies/services/cookies' in '$TMPDIR/embroider/57a24f/services/cookies.js'

@RobbieTheWagner
Copy link
Contributor

Seems that updating embroider fixes that for me.

@skavyas
Copy link

skavyas commented Jul 31, 2023

Hi @BobrImperator, Do you know when 6.0.0 will be released ?

@BobrImperator
Copy link
Collaborator

BobrImperator commented Aug 18, 2023

Ember-simple-auth 6.0.0 released
https://github.com/mainmatter/ember-simple-auth/blob/master/CHANGELOG.md#600-2023-08-18

Sorry for keeping you waiting :)

Feel free to re-open if the is actually not fixed.

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

5 participants