roxiness / routify

Automated Svelte routes
https://routify.dev
1.89k stars 88 forks source link

vite-plugin-svelte: missing exports condition warning (Routify 2.18.12) #543

Open Roger-Sa opened 9 months ago

Roger-Sa commented 9 months ago
[vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no 
exports condition for svelte.

@roxi/routify@2.18.12

Please see https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition for details.

sashasoft90 commented 9 months ago

Hi, same warning from @roxi/routify@3.0.0-next.212

[vite-plugin-svelte] WARNING: The following packages have a svelte field in their package.json but no exports condition for svelte.

@roxi/routify@3.0.0-next.212

My Packages:

  "devDependencies": {
    "@roxi/routify": "^3.0.0-next.212",
    "@sveltejs/vite-plugin-svelte": "^3.0.1",
    "@tsconfig/svelte": "^5.0.2",
    "svelte": "^4.2.8",
    "svelte-check": "^3.6.2",
    "tslib": "^2.6.2",
    "typescript": "^5.2.2",
    "vite": "^5.0.8",
    "vite-tsconfig-paths": "^4.3.1"
  },
james-em commented 9 months ago

@jakobrosenberg

This is a very quick fix. I believe because of this declaration:

https://github.com/roxiness/routify/blob/next/package.json#L6

"svelte": "lib/runtime/index.js",

you just need to add here:

https://github.com/roxiness/routify/blob/next/package.json#L33

"svelte": "./lib/runtime/index.js",

which gives

    "exports": {
        ...
        ".": {
            ...
            "svelte": "./lib/runtime/index.js",
        },
        ...
    },

(Careful there is an extra ./ compared to the old declaration as described here: https://github.com/sveltejs/vite-plugin-svelte/blob/main/docs/faq.md#missing-exports-condition

jakobrosenberg commented 9 months ago

:tada: This issue has been resolved in version 3.0.0-next.216 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

jakobrosenberg commented 9 months ago

Just realised this is for v2 and not v3. 😬

github-actions[bot] commented 9 months ago

:tada: This issue has been resolved in version 2.18.13 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

james-em commented 9 months ago

@jakobrosenberg Thanks a lot! The warning is gone (Testing v3 here) you can close the issue :)

Edit: https://publint.dev/@roxi/routify@3.0.0-next.216 Capture d’écran, le 2024-02-29 à 08 39 01

Appears to be working fine but

github-actions[bot] commented 9 months ago

:tada: This issue has been resolved in version 2.18.14 :tada:

The release is available on:

Your semantic-release bot :package::rocket: