You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is probably a regression in Theo6. When you use multiple imports in a file, the alias resolved in previous files are not available inside other imported files.
while in Theo6 a compilation error is raised in the console:
{ Error: Alias "ALIAS_COLOR1" not found
at allMatches.reduce (MY_FOLDER_PATH/theo6/node_modules/gulp-theo/node_modules/theo/lib/definition.js:171:42)
at MY_FOLDER_PATH/theo6/node_modules/immutable/dist/immutable.js:4420:31
at List.__iterate (MY_FOLDER_PATH/theo6/node_modules/immutable/dist/immutable.js:2208:13)
at List.mixin.reduce (MY_FOLDER_PATH/theo6/node_modules/immutable/dist/immutable.js:4415:12)
at value.update.v (MY_FOLDER_PATH/theo6/node_modules/gulp-theo/node_modules/theo/lib/definition.js:170:40)
at updateInDeepMap (MY_FOLDER_PATH/theo6/node_modules/immutable/dist/immutable.js:1973:22)
at updateInDeepMap (MY_FOLDER_PATH/theo6/node_modules/immutable/dist/immutable.js:1982:23)
at Map.updateIn (MY_FOLDER_PATH/theo6/node_modules/immutable/dist/immutable.js:1280:26)
at Map.update (MY_FOLDER_PATH/theo6/node_modules/immutable/dist/immutable.js:1272:14)
at props.map (MY_FOLDER_PATH/theo6/node_modules/gulp-theo/node_modules/theo/lib/definition.js:169:15)
name: 'Error',
message: 'Alias "ALIAS_COLOR1" not found',
stack: '...',
showStack: false,
showProperties: true,
plugin: 'gulp-theo' }
The text was updated successfully, but these errors were encountered:
Thanks a lot for the detailed report. Could you write a failing test reproducing this issue? That'll help us investigate (or someone can write a fix for it).
@didoo I believe this might have actually been a bug in Theo 5. "imports" are meant to function more like dependencies. For example, in our token files we often have something like
imports:
- ./aliases/color.yml
So in your example above, if imported2 imported imported1, then ALIAS_COLOR1 would be available to imported2
This is probably a regression in Theo6. When you use multiple imports in a file, the alias resolved in previous files are not available inside other imported files.
It's easy to reproduce.
Given this main file:
main.json
and these two imported files:
imported1.json
imported2.json
the generated file in Theo5 is correctly:
main.scss (as an example)
while in Theo6 a compilation error is raised in the console:
The text was updated successfully, but these errors were encountered: