Error: tree.render is not a function

I am experiencing this problem as I am following the steps in HTML/CSS course part 3, lesson 42 Building for Production in CodewithMosh. On the first try, I wrote parcel build index.html then this error was shown and an incomplete dist file was produced. I removed the dist file and wrote parcel build index.html in the terminal again. This error is shown again but now nothing was produced in the dist file. I have no idea what is going on. Please help me. Thanks!

What version of parcel are you using?

Looking at the error it might be related to htmlnano and svg minification. Try creating a .htmlnanorc file and add { "minifySvg": false } to see if it works then. Or try running the build with the flag --no-optimize to disable all minification. Delete the parcel cache as well between builds with a new config.

It does look like there have been updates to the dependencies which might fix it as well. You would need to manually update the dependencies. I’m not sure how easy it is considering how they are integrated into parcel.



It would be helpful if you created a repo with your project so it’s easier to test.

Hi, jjy. I faced same problem. For not blocked here, I found a way.

parcel build --no-minify index.html

It will jump the optimization of parcel and let you going on.

Hope it’s helpful.



I faced the same problem and ths solution works. Thanks!

Just be aware, as far as I can tell --no-minify is for version 1 of parcel (V1 cli docs). For version 2 it should be --no-optimize (V2 cli docs).

From inside the project folder, you can:

Check the version:

npx parcel --version

Check the available build options (flags):

npx parcel --help build

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.