This message was deleted.
# general
s
This message was deleted.
l
Are you calling registerStackTransformation in the other project? It's fine to define the transforming function in the other project, but I think you need to call registerStackTransformation in the project that defines the stack.
a
yeah. in other project and I can't say I like the idea to copy those registers to all projects and instruct every developer to use same registers in every project instead of just calling registerCommonTransforms() or smth like that in index.ts
l
Calling the function from index.ts should be fine, I think. So long as the stack context is that of the calling project, it should be all good. That is, in order to use the transformations in project A, the registerCommonTransforms() function defined in project B needs to be exported (and probably not from its index.ts, since you won't want to load that in project A), and called from project A.
a
that's pretty much what I was trying to do. register function exported by shared project and that's what was causing the problem
l
Unless it's exported with a reference to its "source" project, that should be fine.
I have my version of this code in a module that isn't "in" a project, but that shouldn't make a difference. Code isn't "in" a project unless it's being invoked during a project's ... invocation ¯\_(ツ)_/¯
You may have to experiment with parameters, location, etc. Something is causing it, but I can't tell what.
a
well, its referenced as npm package
both registerStackTransform and related code are in that npm package
l
I haven't done it that way. If you import from the file system instead of a package, does it work? I've only ever imported from the filesystem (I use a monorepo).
a
importing from FS works. with npm even referencing npm locally doesn't work. in fact there's an open issue on it in different context https://github.com/pulumi/pulumi/issues/4669