Skip to content

Projects fail when used with Vite 3.1.0 #53

Closed

Description

@timothyallan

Vite 3.1.0 just got released, and won't run any projects with solid-dnd included. Downgrading to 3.0.9 works fine still though.

Not sure if it's a Vite thing, or something that was in solid-dnd that Vite just let slip until now? Seems Vite-y, as it's complaining about JSX, but the file is clearly .jsx? I figured I'd report here just in case.

Failed to parse source for import analysis because the content contains invalid JS syntax. If you are using JSX, make sure to name the file with the .jsx or .tsx extension.
/Development/Web/project/node_modules/@thisbeyond/solid-dnd/dist/source/sortable-context.jsx:41:35
39 |      return <Context.Provider value={context}>{props.children}</Context.Provider>;
40 |  };
41 |  const useSortableContext = () => {
   |                                    ^
42 |      return useContext(Context) || null;
43 |  };

As far as I can tell, to replicate, just update any project using vite + solid-dnd to vite@3.1.0.

Activity

  1. martinpengellyphillips commented on Sep 7, 2022

    @martinpengellyphillips
    Contributor

    Confirming this still happens with latest 0.7.0 release and Solid JS 1.5+

    Looks like other packages in the Solid ecosystem are affected too.

  2. martinpengellyphillips commented on Sep 12, 2022

    @martinpengellyphillips
    Contributor

    Also reported to Vite here in case they have pointers on how to fix. Interestingly it does not seem to occur for my other Solid project (solid-select).

  3. martinpengellyphillips commented on Sep 14, 2022

    @martinpengellyphillips
    Contributor
  4. martinpengellyphillips commented on Sep 15, 2022

    @martinpengellyphillips
    Contributor

    PR to vite-plugin-solid issued. However, with that fix we will face a new issue with Vite: vitejs/vite#10087 (comment)

  5. martinpengellyphillips commented on Oct 7, 2022

    @martinpengellyphillips
    Contributor

    Closing as this should be resolved on latest of vite and vite-plugin-solid.

    You may still need to add the following to your vite config though to avoid other errors:

    optimizeDeps: {
      extensions: ["jsx"],
    },
    
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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions