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

Non-compiling v1.0.0 #129

Closed
saropa opened this issue Jan 8, 2025 · 8 comments
Closed

Non-compiling v1.0.0 #129

saropa opened this issue Jan 8, 2025 · 8 comments
Assignees
Labels
question Further information is requested

Comments

@saropa
Copy link

saropa commented Jan 8, 2025

Hi,

It looks like the current package source code has a partial implementation of a PR, namely the “environment” variable added to envied_base.dart.

I had to migrate this field over to the stable build to get it to compile:

  /// for the constructor:   this.environment = false,

  /// Whether to read the ultimate values from [Platform.environment] rather
  /// than from the `.env` file.  When set to true, the value found in the
  /// `.env` file will not be used as the ultimate value but will instead be
  /// used as the key and the ultimate value will be read from
  /// [Platform.environment].
  final bool environment;

Cheers,
Saropa

@techouse techouse self-assigned this Jan 14, 2025
@techouse techouse added the question Further information is requested label Jan 14, 2025
@techouse
Copy link
Collaborator

techouse commented Jan 14, 2025

Hey, @saropa! I can't reproduce this error. I just tried using

dependencies:
  envied: ^1.0.0

dev_dependencies:
  envied_generator: ^1.0.0

dependency_overrides:
  envied:
    git:
      url: https://github.com/petercinibulk/envied.git
      ref: main
      path: packages/envied
  envied_generator:
    git:
      url: https://github.com/petercinibulk/envied.git
      ref: main
      path: packages/envied_generator

and it compiles just fine. Can you please clarify how I could reproduce this?

@techouse techouse added the invalid This doesn't seem right label Jan 14, 2025
@saropa
Copy link
Author

saropa commented Jan 14, 2025

Thanks for looking. Sorry, this report could have been more detailed.

I got your latest code (from today) from GitHub and opened in VS Code, here is a sample of the errors.

[{
	"resource": "/src/envied/packages/envied_generator/test/src/generator_tests.dart",
	"owner": "_generated_diagnostic_collection_name_#0",
	"code": {
		"value": "undefined_named_parameter",
		"target": {
			"$mid": 1,
			"path": "/diagnostics/undefined_named_parameter",
			"scheme": "https",
			"authority": "dart.dev"
		}
	},
	"severity": 8,
	"message": "The named parameter 'environment' isn't defined.\nTry correcting the name to an existing named parameter's name, or defining a named parameter with the name 'environment'.",
	"source": "dart",
	"startLineNumber": 1257,
	"startColumn": 16,
	"endLineNumber": 1257,
	"endColumn": 27
}]

For example:

  @EnviedField(environment: false)
  static final String? env1 = null;

In [EnviedField] the field [environment] does not exist.

@techouse techouse removed the invalid This doesn't seem right label Jan 14, 2025
@techouse
Copy link
Collaborator

techouse commented Jan 14, 2025

Hey @saropa!

I'm not sure what you mean, because the test you are referring to

@EnviedField(environment: false)
clearly passes. Also the EnviedField.environment filed does exist
final bool? environment;

However, I think I might know what's confusing you. The crux of those tests is that they rely on an environment (aka argv) variable. In order to run those tests you have to run them with melos test, because those variables are set with melos

env:

@saropa
Copy link
Author

saropa commented Jan 14, 2025

Thanks again, and I hope I'm not wasting your time. I didn't actually run any tests, just opening the project

image

@saropa
Copy link
Author

saropa commented Jan 14, 2025

It could be the pubspec.yaml for [envied_generator] pointing to v1.0.0 online, which doesn't have the field?

  envied: ^1.0.0

Oh, and btw, thanks for the package — it's really important to our build!

@techouse
Copy link
Collaborator

Have you tried running melos bs?

@saropa
Copy link
Author

saropa commented Jan 15, 2025

I don't know what that is, sorry! Ofc, happy for you to close this if it's just a quirk of my dev environment.

The source was going to be used to resolve the dependency conflicts (with other packages) as discussed in #130

@techouse techouse closed this as not planned Won't fix, can't repro, duplicate, stale Jan 15, 2025
@techouse
Copy link
Collaborator

For reference #130 is completely unrelated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants