bundlerparcel

parcel build error: plugin is not a function


I am trying to build a simple web project

project structure like this

-src
--index.html
--index.js
--style.css
package.json
yarn.lock

I installed parcel-bundler with this

yarn global add parcel-bundler

And I run the parcel build command

parcel build src/index.html

But error has occurred followed by this log

D:\playground\js\sample>parcel build src/index.html
×  D:\playground\js\sample\src\style.css:undefined:undefined: plugin is not a function
    at LazyResult.run (C:\Users\pc\AppData\Roaming\nvm\v15.14.0\node_modules\parcel-bundler\node_modules\postcss\lib\lazy-result.js:288:14)
    at LazyResult.asyncTick (C:\Users\pc\AppData\Roaming\nvm\v15.14.0\node_modules\parcel-bundler\node_modules\postcss\lib\lazy-result.js:212:26)
    at C:\Users\pc\AppData\Roaming\nvm\v15.14.0\node_modules\parcel-bundler\node_modules\postcss\lib\lazy-result.js:254:14 
    at new Promise (<anonymous>)
    at LazyResult.async (C:\Users\pc\AppData\Roaming\nvm\v15.14.0\node_modules\parcel-bundler\node_modules\postcss\lib\lazy-result.js:250:23)
    at LazyResult.then (C:\Users\pc\AppData\Roaming\nvm\v15.14.0\node_modules\parcel-bundler\node_modules\postcss\lib\lazy-result.js:131:17)

I'm just following the instruction of parcel's official docs

I cannot find a solution

please help me


Solution

  • Problem solved: parcel-bundler is deprecated. Use 'parcel' not 'parcel-bundler'