TypeError: defaultLoader is not a function
See original GitHub issueDescribe the bug
yarn build
fails on the vue-ts template
Reproduction
Create a new project with the vue-ts template
yarn create @vitejs/app
Install dependencies
yarn
Build
yarn build
System Info
vite
version: 2.0.0-beta.12- Operating System: Windows 10
- Node version: v14.15.4
- Package manager (npm/yarn/pnpm) and version: yarn 1.22.0
Logs (Optional if provided reproduction)
$ C:\projects\vite-test\node_modules\.bin\vite build --debug
failed to load config from /projects/vite-test/vite.config.ts
error during build:
TypeError: defaultLoader is not a function
at Object.require.extensions.<computed> [as .ts] (C:\projects\vite-test\node_modules\vite\dist\node\chunks\dep-30d01443.js:46937:13)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at loadConfigFromBundledFile (C:\projects\vite-test\node_modules\vite\dist\node\chunks\dep-30d01443.js:46941:17)
at loadConfigFromFile (C:\projects\vite-test\node_modules\vite\dist\node\chunks\dep-30d01443.js:46888:32)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async resolveConfig (C:\projects\vite-test\node_modules\vite\dist\node\chunks\dep-30d01443.js:46650:28)
at async doBuild (C:\projects\vite-test\node_modules\vite\dist\node\chunks\dep-30d01443.js:39447:20)
error Command failed with exit code 1.
Issue Analytics
- State:
- Created 3 years ago
- Comments:11 (2 by maintainers)
Top Results From Across the Web
maplibre build-dev "TypeError: defaultLoader is not a function"
Getting the error below trying to build maplibre on my Windows box. Followed the CONTRIBUTING.md steps (node, windows-dev-tools, npm i, .
Read more >cosmiconfig - npm
An object that maps extensions to the loader functions responsible for loading and parsing files with those extensions. Cosmiconfig exposes its ...
Read more >typeerror: (0 , express_1.default) is not a function - You.com
I'm getting [TypeError: (0 , express_1.default) is not a function for my code. import express from "express"; const app = express (); //...
Read more >Error: Image Optimization using Next.js default loader is not ...
[Solved]-Error: Image Optimization using Next.js default loader is not ... error in Next js with redux thunk TypeError: nextCallback is not a function...
Read more >expose-loader - webpack
The require.resolve call is a Node.js function (unrelated to ... By default loader does not override the existing value in the global object,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hmm, weird how the windows CI passed 🤔
I got the same error message on Windows 10 with vite 2.0, but with a slight change: my working directory is a symlink to a longer path.
I was not sure if this is a supported use-case, so please ignore if not.
Details: Actual directory:
C:\Users\<user>Documents\js\viteapp
Symlink: c:\work\viteapp (created usingmklink /D c:\work C:\Users\<user>\Documents\js\
)Vite Version:
Steps (happens in Windows Command Prompt (cmd.exe) and Windows Terminal (wt.exe):
It runs after I move into the actual directory: