Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read property 'type' of undefined #2749

Closed
WayneHiller opened this issue Mar 8, 2019 · 60 comments
Closed

Cannot read property 'type' of undefined #2749

WayneHiller opened this issue Mar 8, 2019 · 60 comments

Comments

@WayneHiller
Copy link

WayneHiller commented Mar 8, 2019

🐛 bug report

I have a small VueJS project. I am running "parcel watch index.html --log-level 4 --out-dir wwwroot" from npm. On version 1.11.0 it would stop reacting to file changes after a few saves. I updated to version 1.12.0 and the same thing is happening but now I get an error (see below).

Note: I downgraded to parcel version 1.10.3 and everything works as expected when watching.

🎛 Configuration (.babelrc, package.json, cli command)

{
  "name": "abs-setup",
  "description": "ABS Setup",
  "author": "Wayne Hiller",
  "scripts": {
    "dev": "parcel watch index.html --log-level 4 --out-dir wwwroot",
    "build": "parcel build index.html --out-dir wwwroot",
    "publish": "npm run build && del-cli bin/Release/netcoreapp2.2/publish && dotnet publish -c Release /p:PublishProfile=Properties\\\\PublishProfiles\\\\FolderProfile.pubxml"
  },
  "devDependencies": {
    "@aspnet/signalr": "1.1.2",
    "@babel/core": "7.3.4",
    "@babel/preset-env": "7.3.4",
    "@vue/component-compiler-utils": "^2.6.0",
    "axios": "0.18.0",
    "bootstrap": "4.3.1",
    "bootstrap-vue": "2.0.0-rc.11",
    "less": "^3.9.0",
    "parcel-bundler": "1.12.0",
    "parcel-plugin-clean-easy": "1.0.2",
    "vue": "2.6.7",
    "vue-axios": "2.1.4",
    "vue-template-compiler": "^2.6.7",
    "del-cli": "1.1.0"
  },
  "dependencies": {
    "vue-hot-reload-api": "^2.3.3"
  },
  "parcelCleanPaths": [
    "wwwroot/*.*",
    "wwwroot/debug"
  ]
}

🤔 Expected Behavior

No error

😯 Current Behavior

Error being generated after 5 or 6 saves of the same .vue file.

[12:13:38 PM]: × Cannot read property 'type' of undefined [12:13:38 PM]: at Bundler.createBundleTree (E:\Development\AIN 2\ABS\Setup\ABS Setup\node_modules\parcel-bundler\src\Bundler.js:652:54) at Bundler.createBundleTree (E:\Development\AIN 2\ABS\Setup\ABS Setup\node_modules\parcel-bundler\src\Bundler.js:719:12) at Bundler.createBundleTree (E:\Development\AIN 2\ABS\Setup\ABS Setup\node_modules\parcel-bundler\src\Bundler.js:719:12) at Bundler.bundle (E:\Development\AIN 2\ABS\Setup\ABS Setup\node_modules\parcel-bundler\src\Bundler.js:298:14) at process._tickCallback (internal/process/next_tick.js:68:7)

🌍 Your Environment

Software Version(s)
Parcel 1.12.0
Node 10.15.2
npm/Yarn 6.9.0
Operating System Win 10 x64
@amatho
Copy link

amatho commented Mar 12, 2019

I am experiencing the same bug, I'm also on x64 Windows 10 and I'm using Visual Studio 2017. I can't reproduce the bug when using another text editor, so it seems to be related to VS 2017.

@WayneHiller
Copy link
Author

I am experiencing the same bug, I'm also on x64 Windows 10 and I'm using Visual Studio 2017. I can't reproduce the bug when using another text editor, so it seems to be related to VS 2017.

I also have the same issue in VS 2019. I have not tried editing in VS code yet, will try that next.

@eihigh
Copy link

eihigh commented Mar 13, 2019

I could repro the same issue randomly in this simple project:

node_modules/
foo.js
bar.css
package.json
// foo.js
import "./bar.css";
console.log("foo");
/* bar.css */
body { margin: 1px; }
{
  "name": "parcel-bug",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "parcel-bundler": "^1.12.1"
  }
}                                                                                                                                                                                                                                                                          
Software Version
parcel 1.12.1
node 11.11.0
npm 6.9.0
OS Arch Linux (in Window10's VirtualBox)

I'm working on git bash and mintty to connect the virtual machine. Editor is Arch's vim.
When I save the files several times, auto rebuilding will stop.
When I restart parcel and save more times, the error caused.

@eihigh
Copy link

eihigh commented Mar 13, 2019

I solved this issue thanks to #2716 and https://parceljs.org/hmr.html#safe-write !
Unfortunately I missed it. Sorry :D

@WayneHiller
Copy link
Author

I solved this issue thanks to #2716 and https://parceljs.org/hmr.html#safe-write !
Unfortunately I missed it. Sorry :D

I don't "think" this is the issue with Visual Studio. If it was I don't see why parcel version 1.10.3 would work fine for me.

@andzdroid
Copy link

I have the exact same issue. createBundleTree calls bundle.findCommonAncestor, which returns undefined. The while loop condition in findCommonAncestor fails immediately because a !== b, so last is undefined and returned.

@foobarbecue
Copy link

foobarbecue commented Mar 24, 2019

This happens intermittently for me using Webstorm on Windows 10, with a barely modified nano-react-app.

Edit: ah, I see, I have to disable safe write in WS

@WayneHiller
Copy link
Author

I upgraded to parcel 1.12.3 same issue. I tried VS code and everything works as expected. There seems to be some kind of conflict with Visual Studio. I tried to find settings to control "Safe Write" but there does not seem to be any :( So for now will have to edit the client side assets in VS code I guess. It is actually a better editor for that anyway and the npm plugin makes parcel watching easy. Just kind of weird having to jump between two programs to work on a project. Still that is easier than working with webpack lol.

@coolswood
Copy link

I have the same problem using WebStorm. But with Atom I don't have one.

@WayneHiller
Copy link
Author

I have the same problem using WebStorm. But with Atom I don't have one.

Can you turn off "Safe Write" in WebStorm? I have not found any way to disable it in Visual Studio yet.

@coolswood
Copy link

I have the same problem using WebStorm. But with Atom I don't have one.

Can you turn off "Safe Write" in WebStorm? I have not found any way to disable it in Visual Studio yet.

I have not found too

@mrdapotts
Copy link

I have had this problem as well but I am using linux/vi and other editors, as pointed out it is a known problem see bug #2716 and https://parceljs.org/hmr.html#safe-write where problem is described along with out to turn of the auto write features off tools such as WebStorm etc are described.

@WayneHiller
Copy link
Author

I have had this problem as well but I am using linux/vi and other editors, as pointed out it is a known problem see bug #2716 and https://parceljs.org/hmr.html#safe-write where problem is described along with out to turn of the auto write features off tools such as WebStorm etc are described.

It seems like this issue is going to keep popping up over and over unless it gets fixed. I don't have any issues at all with Webpack and Visual Studio, what is Webpack using to watch files?

@domenkozar
Copy link

domenkozar commented Apr 5, 2019

I think at the very least, undefined could be caught and advice what is going on and what the user should do.

Note that I've hit this issue with Atom.

@devongovett
Copy link
Member

FYI, we're working on a new watcher for Parcel 2 which should be much more reliable. https://github.com/parcel-bundler/watcher

@WayneHiller
Copy link
Author

FYI, we're working on a new watcher for Parcel 2 which should be much more reliable.

That looks awesome :) Any ETA at all?

@devongovett
Copy link
Member

Well the new watcher will be in Parcel 2. We're getting close to the first alpha, so hopefully not too much longer.

@WayneHiller
Copy link
Author

Great, can't wait to test it out.

@Leftium
Copy link

Leftium commented Apr 26, 2019

I was getting this error intermittently (about 1/3 of the time).

My project was inside a Dropbox folder. After exiting Dropbox, I couldn't reproduce (successfully rebuilt and loaded 40+ times), so Dropbox might be one cause of this bug.

The work-around is to exit Dropbox or move the project outside of Dropbox.

(Interestingly, I've never had this type of problem with WebPack HMR from inside Dropbox.)

@mzedeler
Copy link

mzedeler commented May 8, 2019

Does the watcher have a separate issue that can be used for tracking, @devongovett ?

@WayneHiller
Copy link
Author

Are we any closer to being able to test out parcel 2 with the new watcher yet?

@ncaq
Copy link

ncaq commented Jun 5, 2019

in case Emacs solution when use vcs(git),

(setq vc-make-backup-files nil)

@dgreensp
Copy link

dgreensp commented Jun 6, 2019

I started looking into why deleting a file that's part of a glob causes this error, but I haven't gotten too far. Even if you are working on Parcel 2.0, would you consider fixing this? This isn't some deep tricky file-watching bug; Chokidar is working just fine here. It's a plain old logic bug in Bundler, I'll bet you anything.

@jm3
Copy link

jm3 commented Jun 27, 2019

This still happens in vim with backupcopy=yes and with all plugins disabled. 🙈 😬

VIM - Vi IMproved 8.1 (2018 May 18, compiled Jun 18 2019 20:13:57)
macOS version
Included patches: 1-1550
Compiled by Homebrew
Huge version without GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_any_white
+arabic            +file_in_path      +mouse_urxvt       -tcl
+autocmd           +find_in_path      +mouse_xterm       +termguicolors
+autochdir         +float             +multi_byte        +terminal
-autoservername    +folding           +multi_lang        +terminfo
-balloon_eval      -footer            -mzscheme          +termresponse
+balloon_eval_term +fork()            +netbeans_intg     +textobjects
-browse            +gettext           +num64             +textprop
++builtin_terms    -hangul_input      +packages          +timers
+byte_offset       +iconv             +path_extra        +title
+channel           +insert_expand     +perl              -toolbar
+cindent           +job               +persistent_undo   +user_commands
-clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           +python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          +ruby              +wildmenu
+cursorbind        +lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con        +mksession         +smartindent       -X11
+diff              +modify_fname      -sound             -xfontset
+digraphs          +mouse             +spell             -xim
-dnd               -mouseshape        +startuptime       -xpm
-ebcdic            +mouse_dec         +statusline        -xsmp
+emacs_tags        -mouse_gpm         -sun_workshop      -xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary
+extra_search      +mouse_sgr         -tag_old_static
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
  fall-back for $VIM: "/usr/local/share/vim"
Compilation: clang -c -I. -Iproto -DHAVE_CONFIG_H   -DMACOS_X -DMACOS_X_DARWIN  -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: clang   -L. -fstack-protector-strong -L/usr/local/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/readline/lib  -L/usr/local/lib -o vim        -lncurses -liconv -lintl -framework AppKit  -L/usr/local/opt/lua/lib -llua5.3 -mmacosx-version-min=10.14 -fstack-protector-strong -L/usr/local/lib  -L/usr/local/Cellar/perl/5.30.0/lib/perl5/5.30.0/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc  -L/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/config-3.7m-darwin -lpython3.7m -framework CoreFoundation  -lruby.2.6

@callmejoo
Copy link

same problem now

@dgreensp
Copy link

I want my engineering team to use Parcel, but the fact that it can't correctly watch globs is becoming a problem. I'm tempted to try Parcel 2 to see if it doesn't have bugs so large as "crashes if you add and move files," but I'm not sure how hopeful to be, since it's alpha, and apparently there is a brand-new file watcher?

I'm totally the kind of programmer who would turn up my nose at existing file-watchers and write my own, but existing file-watchers are decent IMO, and the fact that this bug was never fixed, and probably will never be fixed, doesn't give me a ton of confidence in the Parcel team, meaning I wonder if they should be writing a file watcher or just working on shipping reasonably non-buggy software? Will the bugs be fixed, this time, in Parcel 2, or will the team immediately start working on Parcel 3?

I just had to vent some skepticism and frustration there. My lack of faith in the Parcel team may be totally unfounded.

@j127
Copy link

j127 commented Dec 23, 2019

Thanks for the tip. Putting set backupcopy=yes in my .vimrc also fixed the errors for me. (neovim on ubuntu 16.04)

@ampcpmgp
Copy link

I happened to do the same when git hook.
The solution was to drop lint-staged version from 10 -> 7.

@arshbot
Copy link

arshbot commented Apr 28, 2020

Disabling backupcopy worked for me as well ( ubuntu 18 ), however I don't want to disable backups. Setting a new backupdir worked by adding the following lines to my .vimrc

set backupdir=~/misc

You can find more info on backups with :help backup

@jonsa
Copy link

jonsa commented Jun 1, 2020

This can be reproduced without using an editor. I created a simple project displaying the problem.

The gist of it is

  • Start watching files
  • Delete an imported file
  • Watch parcel crash

Tested on Windows 10 and Ubuntu on WSL

@JonathanDn
Copy link

@devongovett Its wonderful that your working on a new watcher. I do not see any ETA for that.

I am using webstorm and still experience this broken watch issue all the time. Any temp fix??

@joestant
Copy link

joestant commented Jun 18, 2020

We've just updated to Visual Studio 2019 Preview and we're certain we didn't experience this before. Does anyone have any known work arounds besides switching to WebPack or editing the file in another editor? Using Windows 10. Parcel Bundler 1.12.4.

Has anyone tried 2.0.0-nightly.2xx builds? Do anyone know when this might get released or how far they are through it?

@mischnic
Copy link
Member

Has anyone tried 2.0.0-nightly.2xx builds? Do anyone know when this might get released or how far they are through it?

We've just release 2.0.0-beta.1 😉

@tghw
Copy link

tghw commented Sep 30, 2020

For anyone using WebStorm/PyCharm/PhpStorm (or any other JetBrains IDE), you can work around this by going to Settings > Appearance & Behavior > System Settings and unchecking "Use 'safe write'" in the Synchronization section.

@JonathanDn

@JonathanDn
Copy link

JonathanDn commented Oct 1, 2020

@tghw Hey, thank you for the update and I appreciate the help. I do understand that this is an open source project and you work on it according to your availability.

But if I may be honest I already decoupled parcel and replaced it with Webpack and I am also sorry I did not started things out with Webpack due to this experience.

Developer experience is super important especially for a build tool. I wasted precious hours on that project for choosing to go with Parcel. I hope you improve your response time if you want to prevent future bounce from this tool.

In a fast-pace environment that we live in as developers and with the standards we aim to from tools we work in responding to an issue after a whole year and a half is inconsiderable. And becomes a major factor to not choosing a certain technology for proudction or honestly also for development.

@tghw
Copy link

tghw commented Oct 1, 2020

@JonathanDn I don't work on ParcelJS, I am just another user of it. I tagged you as a courtesy because you were using the same family of IDE that I was and I figured you would appreciate a workaround. Unfortunately, that seems not to have been the case.

That said, I also want to say that I am greatly appreciative of the team's work on making something far more usable and intuitive than Webpack. It has saved me dozens of hours of configuration, and aside from this minor annoyance, which was easy to work around, it has been a fantastic tool and I'm eagerly looking forward to V2.

Writing a file watcher is not a trivial task and there are a lot of corner cases that can cause a file watcher to stumble. In this case, the common thread of every instance of this error is the IDE or editor saving files by pulling the file out from under Parcel and replacing it with a new one.

Part of using and participating in open source projects is that sometimes you have to solve your own problems. If you had read the comments above and tried to understand the root cause of the issue, especially with the documented workarounds for other IDEs and editors, it should have been trivial for you to find the solution I posted. You could have saved yourself "precious hours" and helped the community at the same time.

Hopefully next time you will try that tack instead of expecting the developers to wait on you hand and foot.

@JonathanDn
Copy link

JonathanDn commented Oct 1, 2020

@tghw than my whole message is not directed at you but to the creators of this library and maintainers(if they are even maintaining it.)

We can agree to disagree on this. When I use a seemignly stable tool I expect the basics to work out of the box. Especially with all the buzz around Parcel and promising of a "lightweight, zero config, stable tool" .

If I would argue that a tool I built is battle-tested and ready for adoption, or would advertise this on various places to get traction and reputation for my project and myself - I would make sure it works. And if it breaks, I would have the decency to sit down and solve critical issues

You try to portray the open source world as a naaive and pink candy store in which you can choose whatever and it's at your own risk. I disagree with that approach deeply.

I think open source is wonderful and have donated various code to projects and created my own repositories and gists that I share with people. I never persuaded a message that my creations should be adopted in serious projects nor did I advertised them.

There are more serious and battle-tested technologies out there. IMO ParcelJS is definitely amature.

Webpack is an industry standard and for a reason.

If ParcelJS or any other competing tool would want developers to actually use them and consider them seriously. This kind of critical issues need to be thought of before advertising. And if discovered after, have some decency to not leave people hanging for over a year without a clear answer.

And your expectation for any user of a package to read all corresponsdense of every issue discovered is not realistic. If you like doing it it's your hobby, enjoy. The majority of people upon installing a tool, just wish to use it for its purpose and go do other stuff.

@tghw
Copy link

tghw commented Oct 1, 2020

@JonathanDn If you are going to comment on an existing issue, on any project, open source or otherwise, then you should at least take the time to read the thread. As was the case here, being too lazy to read a thread makes it very likely that you will miss out on crucial information that could help you solve the problem yourself. No one is expecting you to read every issue in the project, but if one applies to you, do yourself a favor and read it.

By reading it, you might have also understood that the file watcher in V1 could not be fixed for this particular issue because it would be a breaking change, so the developers opted to include the fix in the forthcoming V2. Considering it can be easily worked around, this is a very reasonable decision.

It took me less than 20 minutes to read this thread, understand the problem, and find a workaround for my IDE, helped in part by those who commented before me with workarounds for their IDEs. That's a small price to pay and now Parcel is working great for me. I imagine you spent a whole lot more time porting to Webpack...

@JonathanDn
Copy link

JonathanDn commented Oct 1, 2020

@tghw I did read it a long time ago.

If the issue was resolved there was a clear solution simply written by someone here and upvoted many times.

Back when I tried to solve this I had read everything written here. Tried all the suggestions but failed to make it work. I searched in other threads but could not find a clear way to resolve this.

I thank you for the invitation to continue wasting my and other people's time. I kindly decline.

Moved to work with Webpack and will continue to work with it. Once a serious alternative tool will present itself and will have reasonable support and maintainance time I will consider it as well.

Have a pleasent day / evening.

@JonathanDn
Copy link

@tghw And for the record, there are various standard webpack configurations that give you HMR and what-not in 0 effort. So to your question no I did not spend so much time porting to webpack, i just picked a configuration that fit my purpose, edited it really a bit and thats it.

It really pays off to understand webpack and learn the power it gives you and the level of customization.

For prototyping I use a preconfigurate template(for years now...) and actually even for production and more serious projects I use the tempaltes and adjust as I go according to the project needs. case by case.

@zacharytyhacz
Copy link

zacharytyhacz commented Oct 29, 2020

I am having same issues but with React+Typescript project, anytime I edit an import it shows the error and I have to restart the watch. very weird

  • downgrading parcel to 1.10.3 did not work, still showing error
   "parcel-bundler": "^1.10.3",
Cannot read property 'type' of undefined
    at Bundler.createBundleTree (/home/zac/Projects/score/app/application/client/node_modules/parcel-bundler/src/Bundler.js:654:54)
    at Bundler.createBundleTree (/home/zac/Projects/score/app/application/client/node_modules/parcel-bundler/src/Bundler.js:721:12)
    at Bundler.createBundleTree (/home/zac/Projects/score/app/application/client/node_modules/parcel-bundler/src/Bundler.js:721:12)
    at Bundler.createBundleTree (/home/zac/Projects/score/app/application/client/node_modules/parcel-bundler/src/Bundler.js:721:12)
    at Bundler.createBundleTree (/home/zac/Projects/score/app/application/client/node_modules/parcel-bundler/src/Bundler.js:721:12)
    at Bundler.bundle (/home/zac/Projects/score/app/application/client/node_modules/parcel-bundler/src/Bundler.js:298:14)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    "dependencies": {
        "@testing-library/jest-dom": "^5.11.5",
        "@testing-library/react": "^11.1.0",
        "@types/enzyme-adapter-react-16": "^1.0.6",
        "@types/jest": "^26.0.15",
        "@types/sinon": "^9.0.8",
        "axios": "^0.19.2",
        "bcrypt": "^5.0.0",
        "bootstrap": "^4.5.0",
        "chai": "^4.2.0",
        "chai-http": "^4.3.0",
        "enzyme": "^3.11.0",
        "enzyme-adapter-react-16": "^1.15.5",
        "eslint-config-standard": "^14.1.1",
        "history": "^5.0.0",
        "jest": "^26.6.1",
        "lodash": "^4.17.19",
        "mocha": "^8.0.1",
        "moment": "^2.27.0",
        "pure-store": "^1.1.0",
        "react": "^16.0.0",
        "react-dom": "^15.0.0 || ^16.0.0",
        "react-input-mask": "^3.0.0-alpha.2",
        "react-minimal-pie-chart": "^8.0.1",
        "react-orgchart": "^1.0.5",
        "react-ripples": "^2.2.1",
        "react-router": "^6.0.0-alpha.5",
        "react-router-dom": "^6.0.0-alpha.5",
        "react-table": "^7.1.0",
        "react-tabs": "^3.1.1",
        "react-tag-autocomplete": "^5.13.1",
        "react-tooltip": "^4.2.6",
        "regenerator-runtime": "^0.13.7",
        "ts-jest": "^26.4.3"
    },
    "devDependencies": {
        "@types/bcrypt": "^3.0.0",
        "@types/body-parser": "^1.19.0",
        "@types/enzyme": "^3.10.7",
        "@types/mocha": "^7.0.2",
        "@types/node": "^14.0.13",
        "@types/react": "^16.9.35",
        "@types/react-dom": "^16.9.8",
        "@types/react-input-mask": "^2.0.5",
        "@types/react-table": "^7.0.23",
        "@types/react-tabs": "^2.3.2",
        "@typescript-eslint/eslint-plugin": "^3.7.1",
        "@typescript-eslint/parser": "^3.7.1",
        "eslint": "^7.6.0",
        "eslint-config-airbnb-base": "^14.2.0",
        "eslint-plugin-import": "^2.22.0",
        "eslint-plugin-node": "^11.1.0",
        "eslint-plugin-promise": "^4.2.1",
        "eslint-plugin-react": "^7.21.5",
        "eslint-plugin-standard": "^4.0.2",
        "node-sass": "^4.14.1",
        "parcel-bundler": "^1.12.4",
        "sass": "^1.26.10",
        "sinon": "^9.2.0",
        "sinon-chai": "^3.5.0",
        "ts-node": "^9.0.0",
        "typescript": "^3.9.5"
    }
}

@szszszsz
Copy link

szszszsz commented Nov 3, 2020

FWIW perhaps another cause resulting in the same error message, but in my case removing the .cache directory helped.

@andormade
Copy link

I'm having the same problem on Codeanywhere, I'm going to check if updating to Parcel 2 beta solves this.

@zacharytyhacz
Copy link

I'm having the same problem on Codeanywhere, I'm going to check if updating to Parcel 2 beta solves this.

this has been the solution for me - updating to the next parcel version. parcel 2 seems much better and faster anyway; everything works the same.

@crimsonvspurple
Copy link

crimsonvspurple commented May 12, 2021

So I copied html5boilerplate [ https://github.com/h5bp/html5-boilerplate ] for something and install/run this without any change.
It opened up on my browser just fine.

Left the PC running as it is. Come back after 30 minutes.

yarn run v1.22.5
$ parcel index.html --open
Server running at http://localhost:1234 
Cannot read property 'type' of undefined
    at Bundler.createBundleTree (/home/ubuntu/<snip>/node_modules/parcel-bundler/src/Bundler.js:654:54)
    at Bundler.createBundleTree (/home/ubuntu/<snip>/node_modules/parcel-bundler/src/Bundler.js:721:12)
    at Bundler.createBundleTree (/home/ubuntu/<snip>/node_modules/parcel-bundler/src/Bundler.js:721:12)
    at Bundler.bundle (/home/ubuntu/<snip>/node_modules/parcel-bundler/src/Bundler.js:298:14)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Like how..?

There's just one dependency:

  "devDependencies": {
    "parcel-bundler": "^1.12.4"
  }

@mantelllo
Copy link

Issue exists on v1.12.3 using parcel-bundler with skaffold live update. Are there any plans to fix it? Any workaround suggestions?

@github-actions
Copy link

github-actions bot commented Dec 1, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Dec 1, 2021
@missmilo
Copy link

missmilo commented Apr 1, 2022

FWIW perhaps another cause resulting in the same error message, but in my case removing the .cache directory helped.

Thanks!

@github-actions github-actions bot removed the Stale Inactive issues label Apr 1, 2022
@robozb
Copy link

robozb commented Nov 27, 2022

I experienced the following problem with parcel/chalk:

npm view chalk version
5.1.2
npm view parcel version
2.8.0
node -v
v18.12.1
npm -v
8.19.2

index.js:8 Uncaught TypeError: Cannot destructure property 'stdout' of '(0 , _supportsColorDefault.default)' as it is undefined.
    at 5FSqT.#ansi-styles (index.js:8:16)
    at newRequire (index.5baa4167.js:71:24)
    at localRequire (index.5baa4167.js:84:35)
    at igcvL../math.js (app.js:2:1)
    at newRequire (index.5baa4167.js:71:24)
    at index.5baa4167.js:122:5
    at index.5baa4167.js:145:3

@robozb
Copy link

robozb commented Nov 27, 2022

The things worked with this version: chalk 4.1.2

@ObinnaAka
Copy link

The things worked with this version: chalk 4.1.2

I had the same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests