Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building iles #269

Open
ohuu opened this issue Feb 20, 2024 · 6 comments
Open

Error building iles #269

ohuu opened this issue Feb 20, 2024 · 6 comments

Comments

@ohuu
Copy link

ohuu commented Feb 20, 2024

Hey @ElMassimo I cloned Iles over the weekend and tried to build it using build:all but I'm getting this error. Not sure exactly whats causing it, have you seen it before?

src/pwa.ts(26,3): error TS2321: Excessive stack depth comparing types '{ name: string; config(config: UserConfig): { vite: { plugins: Plugin_2[][]; }; }; configResolved({ base, prettyUrls, srcDir }: AppConfig): void; ssg: { onSiteRendered(): Promise<void>; }; }' and 'IlesModule'.
       src/pwa.ts(28,5): error TS2322: Type '(config: UserConfig) => { vite: { plugins: Plugin_2[][]; }; }' is not assignable to type '(config: UserConfig, env: ConfigEnv) => void | UserConfig | Promise<void | UserConfig | null> | null'.
         Type '{ vite: { plugins: Plugin_2[][]; }; }' is not assignable to type 'void | UserConfig | Promise<void | UserConfig | null> | null'.
           Type '{ vite: { plugins: Plugin_2[][]; }; }' is not assignable to type 'UserConfig'.
             The types of 'vite.plugins' are incompatible between these types.
               Type 'Plugin_2[][]' is not assignable to type 'PluginOption[]'.
                 Type 'Plugin_2[]' is not assignable to type 'PluginOption'.
                   Type 'Plugin_2[]' is not assignable to type 'PluginOption[]'.
                     Type 'Plugin_2' is not assignable to type 'PluginOption'.
                       Type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").Plugin' is not assignable to type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").Plugin'.
                         Types of property 'apply' are incompatible.
                           Type '"serve" | "build" | ((this: void, config: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").UserConfig, env: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined' is not assignable to type '"serve" | "build" | ((this: void, config: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").UserConfig, env: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index"...'.
                             Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean) | undefined'.
                               Type '(this: void, config: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").UserConfig, env: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").UserConfig, env: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
                                 Types of parameters 'config' and 'config' are incompatible.
                                   Type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").UserConfig'.
                                     Types of property 'plugins' are incompatible.
                                       Type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
                                         Type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").PluginOption[]'.
                                           Type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").PluginOption'.
                                             Type 'Plugin_2' is not assignable to type 'PluginOption'.
                                               Type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").Plugin' is not assignable to type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").Plugin'.
                                                 Types of property 'apply' are incompatible.
                                                   Type '"serve" | "build" | ((this: void, config: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").UserConfig, env: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index"...' is not assignable to type '"serve" | "build" | ((this: void, config: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").UserConfig, env: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").ConfigEnv) => boolean) | undefined'.
                                                     Type '(this: void, config: UserConfig, env: ConfigEnv) => boolean' is not assignable to type '"serve" | "build" | ((this: void, config: UserConfig, env: ConfigEnv) => boolean) | undefined'.
                                                       Type '(this: void, config: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").UserConfig, env: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").ConfigEnv) => boolean' is not assignable to type '(this: void, config: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").UserConfig, env: import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").ConfigEnv) => boolean'.
                                                         Types of parameters 'config' and 'config' are incompatible.
                                                           Type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").UserConfig' is not assignable to type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").UserConfig'.
                                                             Types of property 'plugins' are incompatible.
                                                               Type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").PluginOption[] | undefined' is not assignable to type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").PluginOption[] | undefined'.
                                                                 Type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").PluginOption[]' is not assignable to type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").PluginOption[]'.
                                                                   Type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.5.2/node_modules/vite/dist/node/index").PluginOption' is not assignable to type 'import("C:/Users/ohuu/Workspace/iles/node_modules/.pnpm/vite@4.4.0-beta.3_@types+node@17.0.45/node_modules/vite/dist/node/index").PluginOption'.
                                                                     Type 'PluginOption[]' is not assignable to type 'PluginOption'.

Error: error occured in dts build
    at Worker.<anonymous> (C:\Users\ohuu\Workspace\iles\node_modules\.pnpm\tsup@6.1.2_@swc+core@1.3.8_postcss@8.4.24_typescript@4.4.4\node_modules\tsup\dist\index.js:2073:22)
    at Worker.emit (node:events:518:28)
    at MessagePort.<anonymous> (node:internal/worker:263:53)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:826:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28)
DTS Build error
Error: Failed to compile. Check the logs above.
    at error (C:\Users\ohuu\Workspace\iles\node_modules\.pnpm\rollup@2.75.7\node_modules\rollup\dist\shared\rollup.js:198:30)
    at throwPluginError (C:\Users\ohuu\Workspace\iles\node_modules\.pnpm\rollup@2.75.7\node_modules\rollup\dist\shared\rollup.js:21938:12)
    at Object.error (C:\Users\ohuu\Workspace\iles\node_modules\.pnpm\rollup@2.75.7\node_modules\rollup\dist\shared\rollup.js:22661:20)
    at Object.error (C:\Users\ohuu\Workspace\iles\node_modules\.pnpm\rollup@2.75.7\node_modules\rollup\dist\shared\rollup.js:22115:42)
    at Object.transform (C:\Users\ohuu\Workspace\iles\node_modules\.pnpm\tsup@6.1.2_@swc+core@1.3.8_postcss@8.4.24_typescript@4.4.4\node_modules\tsup\dist\rollup.js:8358:20)
    at C:\Users\ohuu\Workspace\iles\node_modules\.pnpm\rollup@2.75.7\node_modules\rollup\dist\shared\rollup.js:22870:37
 ELIFECYCLE  Command failed with exit code 1.
@ouuan
Copy link
Contributor

ouuan commented Feb 20, 2024

You need to pin Vite and Vue versions to the one used by iles. The dependencies are not getting updated. I really hope that they do, even if iles itself is inactive.

@ElMassimo
Copy link
Owner

Hi Oliver, thanks for reporting!

Failures to build @islands/pwa could be related to upgrading the Vite version but not the vite-plugin-pwa version.

I have a vite-5 branch where I've updated most dependencies, but it's not yet building in its entirety (only some packages are). I intend to ship a new version, but I haven't had any spare time for this in the past few months.

@TechAkayy
Copy link

Try pinning vue & vite in package.json

"overrides": {
    "vue": "3.3",
    "vite": "4.4"
},
"pnpm": {
    "overrides": {
      "vue": "3.3",
      "vite": "4.4"
    }
}

@ohuu
Copy link
Author

ohuu commented Feb 26, 2024

Thanks all. Pinning works a treat!

@ohuu ohuu closed this as completed Feb 26, 2024
@ohuu
Copy link
Author

ohuu commented Mar 8, 2024

I have iles building locally now but I want to be able to test my changes. I guess in order to do that I'll need a test project that uses my local build of iles?

I've tried adding iles to a test project by using yarn add file:.\<path_to_iles> but that errors with this message Invalid filename: "file:.\..\..\iles-npm-0.9.5-5875663749.

Any advice on testing iles?

@ohuu ohuu reopened this Mar 8, 2024
@TechAkayy
Copy link

Adding local filepath worked for me with npm & pnpm on my Mac.

With npm, I usually install it to my test project with the full path of the project, for eg, npm install file:/Users/techakayy/projects/iles, and the test project's package.json shows it relatively like this iles: "file:../../projects/iles", (test project lives elsewhere on my drive).

With pnpm, I usually add iles: "link:../../projects/iles", to my package.json and pnpm install gets it right.

I haven't used yarn, and it might be different on Windows, sorry :-) Try yarn add <full path>!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants