adobe / reactor-sandbox

Tasks for creating a sandbox for manually testing Adobe Experience Platform Tags extensions.
Apache License 2.0
7 stars 15 forks source link

turbine.environment is undefined when running the library sandbox #77

Closed jonsnyder closed 2 years ago

jonsnyder commented 2 years ago

Expected Behaviour

turbine.environment should be defined and available when running the library sandbox. Ideally, you would be able to set the stage in the library settings somewhere so you could test your code with different environment.stages.

Actual Behaviour

turbine.environment is undefined.

Reproduce Scenario (including but not limited to)

We have code in the alloy extension to use a different data-stream depending on the environment. During testing today, I noticed errors when running the library sandbox that we don't see in the production site. I realized it was because we access turbine.environment.stage when turbine.environment is undefined.

Steps to Reproduce

Within library code, access turbine.environment.stage. Load the library sandbox, and see the null pointer error in the console.

Sample Code that illustrates the problem

const stage = turbine.environment.stage;
module.exports = settings => {
};
brenthosie commented 2 years ago

@Adobe export issue to Jira project PDCL as Story

github-jira-sync-bot commented 2 years ago

:x: Something went wrong. Cannot create Jira issue.

brenthosie commented 2 years ago

@jonsnyder I believe as a fast workaround that if you add an environment section to your .sandbox/container.js file then this should have the behavior you desire.