https://pulumi.com logo
#general
Title
# general
w

worried-honey-61577

03/15/2021, 8:43 PM
Hey guys! We just wrote our first serious dynamic provider in TypeScript, and we’re excited about it. I noticed that when you compile the TypeScript into JS and run it, you get this error:
Copy code
'() => provider': index.js(19,37): captured
      variable 'provider' which indirectly referenced
        function 'DatabaseChangeLogResourceProvider': DatabaseChangeLogResourceProvider.js(28,15): which referenced
          function 'generateChangeLogFile': DatabaseChangeLogResourceProvider.js(32,25): which captured
            variable 'fs' which indirectly referenced
              function 'writeFileSync': which referenced
                function 'getOptions': which captured
                  'ERR_INVALID_ARG_TYPE', a function defined at
                    function 'NodeError': which referenced
                      function 'getMessage': which captured
                        variable 'messages' which indirectly referenced
                          function 'get': which could not be serialized because
                            it was a native code function.
It works perfectly fine if you reference it in TypeScript. I care about this because I’d like to put it in an NPM package and use it in many applications. Any ideas?