question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bundle misses modules

See original GitHub issue

I’m not sure if it’s the right title for the issue, let me know if there’s a better one.

I’ve used x0 on my main laptop and it worked fantastic, but when I tried setting it up on another one, I can’t get it to work. I constantly see this error:

❯ x0 build demo
 x0  @compositor/x0
 x0  ⠧ building static sitewebpack:///../n/lib/node_modules/@compositor/x0/node_modules/buble/dist/buble.es.js?:269
var tt = acorn__WEBPACK_IMPORTED_MODULE_0__["default"].tokTypes;
                                                       ^

TypeError: Cannot read property 'tokTypes' of undefined
    at eval (webpack:///../n/lib/node_modules/@compositor/x0/node_modules/buble/dist/buble.es.js?:269:56)
    at Module.../n/lib/node_modules/@compositor/x0/node_modules/buble/dist/buble.es.js (/Users/vadimdemedes/Projects/dist/TEMP/App.js:534:1)
    at __webpack_require__ (/Users/vadimdemedes/Projects/dist/TEMP/App.js:30:30)
    at eval (webpack:///../n/lib/node_modules/@compositor/x0/node_modules/react-live/dist/react-live.es.js?:26:63)
    at Module.../n/lib/node_modules/@compositor/x0/node_modules/react-live/dist/react-live.es.js (/Users/vadimdemedes/Projects/dist/TEMP/App.js:2849:1)
    at __webpack_require__ (/Users/vadimdemedes/Projects/dist/TEMP/App.js:30:30)
    at eval (webpack:///../n/lib/node_modules/@compositor/x0/src/LiveEditor.js?:11:18)
    at Object.../n/lib/node_modules/@compositor/x0/src/LiveEditor.js (/Users/vadimdemedes/Projects/dist/TEMP/App.js:5361:1)
    at __webpack_require__ (/Users/vadimdemedes/Projects/dist/TEMP/App.js:30:30)
    at eval (webpack:///../n/lib/node_modules/@compositor/x0/src/scope.js?:30:19)

I’ve tried reinstalling Node.js via multiple methods (official package, homebrew, n) and even reproduced the same issue in a fresh Docker container ($ docker run --rm -it node bash). Steps are all the same and taken from the official readme:

  1. $ npm i -g @compositor/x0
  2. $ mkdir demo
  3. $ vim index.js and insert this:
import React from 'react'

export default class extends React.Component {
  render () {
    return (
      <h1>Hello</h1>
    )
  }
}
  1. $ x0 docs --open
  2. I get the same error output either in browser console or in terminal when using x0 build.

I’ve also made a video how I reproduce this in a Docker container: https://www.dropbox.com/s/0ktvsx1n2bkmwma/x0.mov?dl=0.

I thought it might have something to do with module resolution and global modules, but since it fails in an isolated Docker container, it might be a bug in x0.

Unfortunately I had to give up that other laptop with working x0 for repair, so I can’t find the differences now. Would appreciate any ideas on what might be wrong with my set up 😃

Thank you for an amazing piece of software!

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:19 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mokkymiahcommented, Oct 20, 2018

Thank you very much for your hard work! I will try again on Monday 😃

Get Outlook for Androidhttps://aka.ms/ghei36


From: John Otander notifications@github.com Sent: Saturday, October 20, 2018 3:49:36 PM To: c8r/x0 Cc: Mokbul Miah; Manual Subject: Re: [c8r/x0] Bundle misses modules (#106)

I published a temporary fix as 6.0.7. Please let me know if you see any more issue or this fix doesn’t work for you. Thanks for reporting! ❤️

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/c8r/x0/issues/106#issuecomment-431588267, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALkmpMFrx8t_eudq2ye7npdOqKYtOpTqks5umzgAgaJpZM4XjNfS.

1reaction
vadimdemedescommented, Oct 20, 2018

It looks like tokTypes error is gone now and x0 works beautifully, thank you! Unfortunately when including evergreen-ui, I still see the following error https://gist.github.com/vadimdemedes/2b5d1bf80e1646c7f078ff71f6e40d71. But that seems like unrelated to x0, something must be wrong there instead.

Thanks a lot for fixing this, I’m a really happy user of x0!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Demystifying Code Bundling with JavaScript Modules
The compiler combines modules into a “bundle”, then transpiles the code to another ECMAScript syntax. This is often called “code bundling” ...
Read more >
Why is Webpack build missing some third-party dependencies?
Debugging indicates that there are a number of my dependencies from "node_modules" that are not listed in the modules map as expected.
Read more >
How to Bundle your Modules with Webpack - YouTube
comWebpack is an open-source JavaScript module bundler that enables... ... Webpack Tutorial - How to Bundle your Modules with Webpack.
Read more >
Managing dependencies - The Go Programming Language
dev. Import the packages you want in your code. Add your code to a module for dependency tracking (if it isn't in a...
Read more >
Optimization - webpack
webpack is a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser, yet it is also capable...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found