Missing dependency in Tutorial 3 - Developing a simple interface-only app

Hello,

Tutorial 3 - Developing a simple interface-only app is currently broken in Nextcloud 31.

At step 5, npm run dev fails with this error

error during build:
[vite]: Rollup failed to resolve import “@nextcloud/paths” from “/home/user/public_html/nextcloud/apps-extra/catgifs/node_modules/@nextcloud/dialogs/dist/chunks/index-hZPKu-D6.mjs”.
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
build.rollupOptions.external

It seems @nextcloud/paths is missing when we add dependencies to package.json at step 2. The last command should probably be :

npm i --save @nextcloud/axios @nextcloud/dialogs @nextcloud/initial-state @nextcloud/router @nextcloud/paths

At least, I tried this and then building worked. :slight_smile:

npm run dev

> catgifs@1.0.0 dev
> vite --mode development build

Building catgifs for development

(!) build.outDir must not be the same directory of root or a parent directory of root as this could cause Vite to overwriting source files with build outputs.

vite v7.1.12 building for development...
✓ 1144 modules transformed.
./css/catgifs-main.css             0.08 kB │ gzip:   0.10 kB
./css/main-_2--zc7X.chunk.css    327.10 kB │ gzip:  38.68 kB
./js/catgifs-main.mjs          1,771.17 kB │ gzip: 386.87 kB │ map: 4,598.70 kB
✓ built in 5.95s

Ping @edward

While I’m not experiencing the same error on my end, I guess it wouldn’t hurt to explicitly declare the package as an additional dependency anyway. It has now been added to the tutorial, thanks for reporting! :+1:

1 Like