# general


04/27/2020, 10:37 PM
👋 New to Pulumi and so far so good. Something that's tripping me up is that I can't seem to get 2 stacks to work together that have a different runtime. I have a typescript stack that's outputting an image:
Copy code
(venv) ~/***/pulumi/projects/images/config $ pulumi stack output image
and then a python stack that's trying to import it then pass it to a Component:
Copy code
env = pulumi.get_stack()
image_stack = pulumi.StackReference(f"jdrake/***-image-config/{env}")
image = image_stack.get_output("image")
service = Service("***", env, image, port=80)
However, running
pulumi up
gives me:
Copy code
error: Program failed with an unhandled exception:
    error: Traceback (most recent call last):
      File "/usr/local/bin/pulumi-language-python-exec", line 85, in <module>
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/asyncio/", line 484, in run_until_complete
        return future.result()
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/asyncio/", line 180, in _step
        result = coro.send(None)
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/site-packages/pulumi/runtime/", line 81, in run_in_stack
        await run_pulumi_func(lambda: Stack(func))
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/site-packages/pulumi/runtime/", line 34, in run_pulumi_func
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/site-packages/pulumi/runtime/", line 81, in <lambda>
        await run_pulumi_func(lambda: Stack(func))
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/site-packages/pulumi/runtime/", line 104, in __init__
      File "/usr/local/bin/pulumi-language-python-exec", line 84, in <lambda>
        coro = pulumi.runtime.run_in_stack(lambda: runpy.run_path(args.PROGRAM, run_name='__main__'))
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/", line 280, in run_path
        run_name, mod_spec, pkg_name).copy()
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/", line 85, in _run_code
        exec(code, run_globals)
      File "./", line 8, in <module>
        service = Service("***", env, image, port=80)
      File "/Users/jdrake/talos/pulumi/components/service/src/ns_pulumi_component_service/", line 86, in __init__
        "portMappings": [{"containerPort": port, "protocol": "tcp"}],
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/json/", line 231, in dumps
        return _default_encoder.encode(obj)
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/json/", line 199, in encode
        chunks = self.iterencode(o, _one_shot=True)
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/json/", line 257, in iterencode
        return _iterencode(o, 0)
      File "/Users/jdrake/.pyenv/versions/3.6.8/lib/python3.6/json/", line 180, in default
    TypeError: Object of type 'Output' is not JSON serializable
    error: an unhandled error occurred: Program exited with non-zero exit code: 1
This is failing when I try to use that image value in a task definition: