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

[BUG] No ApplicationChannel subclass found in bscan/bscan : Package file 'file:///root/bscaschan.nofifty.one/.packages' not found. Run 'pub get' and retry. #111

Closed
justintim-es opened this issue Sep 11, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@justintim-es
Copy link

justintim-es commented Sep 11, 2022

in the past i could upload my conduit application and name it to whatever on github running pub get once and voila conduit build works too. Since i dont know when i get the following error when i try to run conduit build i have run pub get but nothing happens. Also not when i name the package to bscan

@justintim-es justintim-es added the bug Something isn't working label Sep 11, 2022
@pro100svitlo
Copy link

same problem

@dm-ra-01
Copy link

This is a result of a breaking change in Dart and breaks many of Conduit's CLI commands eg. conduit build, conduit serve.
Reference: dart-lang/sdk#48272

To help the dev team on their way, there are two fixes which may help:
Option 1: Change the string from .packages to the new json file

packages/conduit/lib/src/cli/mixins/project.dart

Replace:
Uri get packageConfigUri => projectDirectory!.uri.resolve(".packages");
with
Uri? get packageConfigUri => projectDirectory!.uri.resolve(".dart_tool/package_config.json");

packages/runtime/lib/src/build_manager.dart
Line 58, replace:
packageConfigURI: sourceDirectoryUri.resolve(".packages"),
with
packageConfigURI: sourceDirectoryUri.resolve(".dart_tool/package_config.json"),

Similar changes needed to any other file referencing .packages eg. packages/conduit/lib/src/cli/commands/serve.dart and test packages.

This change has been tested and resolved the issue. I just can't identify if it is the most elegant fix.

Option 2: Implement Dart package_config , an official Dart package: https://pub.dev/packages/package_config

Thanks everyone for your hard work with Conduit

@Rodsevich
Copy link

Rodsevich commented Sep 21, 2022

Can you make a PR with this fix, @dm-ra-01, please?

@amine-zergan
Copy link

still same problem, with those upgrades !
Uncaught error
Bad state: Package file 'file:///./.packages' not found. Run 'pub get' and retry.,

@dm-ra-01
Copy link

dm-ra-01 commented Sep 27, 2022

Can you make a PR with this fix, @dm-ra-01, please?

Argh, so sorry for missing this, I've raised a PR now #114

@kbaylosis
Copy link

Without changing anything in the conduit code, you can do this temporarily until a proper fix/PR is applied.

On your project root directory:

ln -s .dart_tool/package_config.json .packages

Find and change this in your package_config.json:

{
      "name": "<YOUR PROJECT'S NAME>",
      "rootUri": "../",
      "packageUri": "lib/",
      "languageVersion": "2.12"
}

to

{
      "name": "<YOUR PROJECT'S NAME>",
      "rootUri": ".",
      "packageUri": "lib/",
      "languageVersion": "2.12"
}

NOTE: You have to re-apply this every time you run a dart pub get.

@j4qfrost
Copy link

Fixed with the latest release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants