I started using dotEnv in a Coldbox installation.
dotEnv correctly reads the values in my .env file and I can use ${var_name} in my server.json.
The problem is Coldbox: with dotEnv installed it raises an exception.
The following:
The Error Occurred in
[my_path]\test-coldbox\modules\coldbox\system\ioc\Builder.cfc: line 645**
643: } )
644: ),
**645: type = "Builder.DSLDependencyNotFoundException"**
646: );
647: }
Message:
The target 'EnvironmentFileService@commandbox-dotenv' requested a missing dependency with a Name of 'moduleSettings' and DSL of 'commandbox:moduleSettings:commandbox-dotenv'
Detail:
{"ref":null,"required":true,"argName":"","dsl":"commandbox:moduleSettings:commandbox-dotenv","javaCast":null,"name":"moduleSettings","type":"any","value":null,"scope":"variables"}
Am I doing it wrong somewhere?
Here you can find a test pakacge:
http://www.coridalia.cc/tmp/test-coldbox-dotenv.zip
It’s enough to unzip the file in a CommandBox directory and type:
install
start server
Then point the browser to:
http://localhost:9914/
to see the error.
I try with this version of Lucee:
- lucee@6.0.0.451-BETA
- lucee@5.4.0.80
- lucee@5.3.10.97
… and with this release of Coldbox:
- “coldbox”:“6.8.1”,
- “coldbox”:“6.8.2+6”,
- “coldbox”:“7.0.0+7”,
I hope this can help you.
Thank you!