getappmap / appmap-js

Client libraries for AppMap
48 stars 17 forks source link

Packaging issue with dom-to-svg, module, typescript, and webpack #1000

Open brikelly opened 1 year ago

brikelly commented 1 year ago

From @kgilpin :

appmap-js components test is breaking on my import of dom-to-svg, does anyone know how to fix this?

FAIL  tests/unit/VsCodeExtension.spec.js
  ● Test suite failed to run

    /Users/kgilpin/source/appland/appmap-js/node_modules/dom-to-svg/lib/index.js:1
    ({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,global,jest){import * as postcss from 'postcss';
                                                                                             ^^^^^^

    SyntaxError: Cannot use import statement outside a module

       5 | <script>
       6 | import assert from 'assert';
    >  7 | import { elementToSVG, inlineResources } from 'dom-to-svg';
         | ^
       8 |
       9 | export default {
      10 |   name: 'v-download-sequence-diagram',

      at ScriptTransformer._transformAndBuildScript (../../node_modules/@vue/cli-plugin-unit-jest/node_modules/@jest/transform/build/ScriptTransformer.js:537:17)
      at src/components/sequence/DownloadSequenceDiagram.vue:7:1
      at Object.<anonymous> (src/components/sequence/DownloadSequenceDiagram.vue:46:3)
brikelly commented 1 year ago

@ahtrotta is this the issue you fixed?

ahtrotta commented 1 year ago

Yes! It's not merged yet, though

ahtrotta commented 1 year ago

Fixed here