sveltejs / sapper

The next small thing in web development, powered by Svelte
https://sapper.svelte.dev
MIT License
7.02k stars 437 forks source link

Updated to latest version and getting a strange error when running npm run dev #1784

Open go-aegian opened 3 years ago

go-aegian commented 3 years ago

When building throws this warning (node:19188) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at xxxxx\node_modules\tslib\package.json. Update this package.json to use a subpath pattern like "./". (Use node --trace-deprecation ... to show where the warning was created) (node:19188) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at xxxxx\node_modules\msal\node_modules\tslib\package.json. Update this package.json to use a subpath pattern like "./".

After it builds looks ok until attempting to access via browser localhost:3000

Listening on http://localhost:3000

_xxxxx\node_modules\polka\build.js:64 let info = this.parse(req, true); ^

TypeError: this.parse is not a function at Polka.handler (xxxxx\node_modules\polka\build.js:64:19) at processImmediate (node:internal/timers:466:21)

Server crashed_

go-aegian commented 3 years ago

Here are the dependencies installed, node v16.4.0, npm v7.19.0

"dependencies": { "@types/uuid": "^8.3.0", "add": "^2.0.6", "body-parser": "^1.19.0", "compression": "^1.7.4", "cors": "^2.8.5", "cross-env": "^7.0.3", "date-fns": "^2.22.1", "dotenv": "^10.0.0", "flatpickr": "^4.6.9", "fs": "^0.0.2", "https": "^1.0.0", "moment": "^2.29.1", "node-fetch": "^2.6.1", "polka": "next", "prebuild": "^10.0.1", "random-uuid-v4": "^0.0.9", "sirv": "^1.0.12", "uuid": "^8.3.2", "uuid-v4": "^0.1.0" }, "devDependencies": { "@babel/core": "^7.14.6", "@babel/plugin-syntax-dynamic-import": "^7.8.3", "@babel/plugin-transform-runtime": "^7.14.5", "@babel/preset-env": "^7.14.7", "@babel/runtime": "^7.14.6", "@rollup/plugin-babel": "^5.3.0", "@rollup/plugin-commonjs": "^19.0.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.0.0", "@rollup/plugin-replace": "^2.4.2", "autoprefixer": "^10.2.6", "node-sass": "^6.0.0", "npm-run-all": "^4.1.5", "postcss": "^8.3.5", "rollup": "^2.52.3", "rollup-plugin-svelte": "^7.1.0", "rollup-plugin-svelte-svg": "^0.2.3", "rollup-plugin-terser": "^7.0.2", "sapper": "^0.29.1", "svelte": "^3.38.3", "svelte-i18n": "^3.3.9", "svelte-preprocess": "^4.7.3" }

Just running npm run dev generates that error, there are no other repro steps

Oliver-Piorun commented 3 years ago

Try "polka": "1.0.0-next.11"

Greetings!

go-aegian commented 3 years ago

Thanks @Oliver-Piorun it worked, only getting a strange message

(node:5164) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at d:\project\test\node_modules\tslib\package.json. Update this package.json to use a subpath pattern like "./*". (Use node --trace-deprecation ... to show where the warning was created)

Oliver-Piorun commented 3 years ago

Hi! Seems like this issue/warning is already known: https://github.com/microsoft/tslib/issues/134 Does it affect the build of your sapper app?

Greetings!

go-aegian commented 3 years ago

Hi Oliver, thanks for your reply. No it does not affect build/run at all.