Skip to content

bug: typescript imports using windows paths #4543

Closed

Description

@mrginglymus

Prerequisites

Stencil Version

4.0.1

Current Behavior

On Windows, the dist-custom-elements target generates a dist/components/index.d.ts with some unescaped windows paths:

/* stencil custom elements */
export { Icon as VIcon } from '..\types\components\icons\icon';
export { defineCustomElement as defineCustomElementVIcon } from './v-icon';

Expected Behavior

/* stencil custom elements */
export { Icon as VIcon } from '../types/components/icons/icon';
export { defineCustomElement as defineCustomElementVIcon } from './v-icon';

System Info

System: node 16.20.0
    Platform: windows (10.0.19045)
   CPU Model: Intel(R) Xeon(R) Gold 5220 CPU @ 2.20GHz (8 cpus)
    Compiler: ...\playground\node_modules\.store\@stencil-core-npm-4.0.1-81248f31a7\node_modules\@stencil\core\compiler\stencil.js
       Build: 1687953951
     Stencil: 4.0.1
  TypeScript: 5.0.4
      Rollup: 2.42.3
      Parse5: 7.1.2
      Sizzle: 2.42.3
      Terser: 5.18.1

Steps to Reproduce

On Windows, the dist-custom-elements target generates a dist/components/index.d.ts with some unescaped windows paths

Code Reproduction URL

n/a

Additional Information

No response

Activity

  1. changed the title [-]bug: [/-] [+]bug: typescript imports using windows paths[/+] on Jul 4, 2023
  2. alicewriteswrongs commented on Jul 5, 2023

    @alicewriteswrongs
    Contributor

    @mrginglymus thanks for filing this issue, we recently made a change (in Stencil 4) that changed how paths are normalized in Stencil which is responsible for this regression. I'll take a look at your PR and get this addressed!

    Thanks again for filing 🙂

  3. added
    Bug: Validated
    on Jul 5, 2023
  4. added a commit that references this issue on Jul 5, 2023
  5. alicewriteswrongs commented on Jul 5, 2023

    @alicewriteswrongs
    Contributor

    @mrginglymus unfortunately I don't have a windows machine handy for testing so I have to rely on our windows CI but I think I have a PR up (#4545) which will address the issue somewhat comprehensively. Is there any chance you could try running a dev build of Stencil to see if it fixes the issue for you?

    If so, you can install it like this:

    npm install --save-dev @stencil/[email protected]
  6. mrginglymus commented on Jul 6, 2023

    @mrginglymus
    Author

    Ah, that looks amazing, thanks so much for the quick and comprehensive response. I'll try and test this afternoon.

  7. mrginglymus commented on Jul 6, 2023

    @mrginglymus
    Author

    Yes, that build has worked perfectly for me :)

  8. alicewriteswrongs commented on Jul 6, 2023

    @alicewriteswrongs
    Contributor

    Excellent, thanks for taking the time to test that out! I'll get that PR reviewed and merged in soon and it will be in the next release if all goes according to plan.

  9. alicewriteswrongs commented on Jul 14, 2023

    @alicewriteswrongs
    Contributor

    Just merged #4545, so it will be included in the next Stencil release. Thanks for reporting @mrginglymus!

  10. rwaskiewicz commented on Jul 24, 2023

    @rwaskiewicz
    Member

    The fix for this issue has been released as a part of today's Stencil v4.0.2 release. As a result, I'm going to close this issue. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug: Validated

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions