-
Notifications
You must be signed in to change notification settings - Fork 201
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
[question] Integrating terminal-kit with webpack project #176
Comments
@dustyhorizon Hi, on v2.1.3, try loading a new entry point: |
@cronvel Thanks for the new feature but seems like its not working with the webpack polyfill for browser targets and xterm.js. Was hoping that I could use terminal-kit for local-echo in xterm.js in browser. |
@dustyhorizon Can you explain a bit what is happening? Which polyfill breaks things? |
With a simple vue-cli init-ed project and xterm.js initialized, I did a simple shim for stdin/stdout/stderr via
With your new entry point I am having new errors like the following:
I am thinking that it may be due to me trying to get terminal-kit running on xterm.js, the stdin/stdout/stderr shim is needed for commander.js to work. EDIT: Also I got this error in chrome's console, not sure if it helps
|
@dustyhorizon It is caused by the optional chaining |
@cronvel Thanks for the heads up, adding
For completeness, the following is the output from
I assume that child_pty is not required for use in a browser target + xterm.js? |
@dustyhorizon You can safely ignore |
@dustyhorizon I can eventually create a browser build, if it's not too much time consuming. But as a back-end developer I would use Browserify instead of webpack (easiest for me to set up). |
@dustyhorizon Ok, v2.1.4 now have a browser build, that you can find in the |
Hey @cronvel thanks for working on this. Unfortunately I am still not able to get it to work (erroring at "Cannot find module ./Rect.js"). I tried troubleshooting and it seems that its erroring when trying to lazy require ./Rect.js via this function I am using Webpack as it came with the vue-cli project generator (via Appreciate you looking into this! The following is the error output on console and the lines it refers to if it helps
|
@dustyhorizon Sorry for that no-brainer patch... This one should work: v2.1.5. |
@cronvel have managed to get it working without errors but seems like mocking stdin/stdout with xterm.js doesn't work well in the browser. Managed to get output working but inputs aren't, probably an issue with how I mocked the write prototype. Will continue to fiddle more once I am done with this other project I am doing though. Heres a screengrab, thanks for the help so far! |
@dustyhorizon Have in mind that chunk's split in the stream have meaning. E.g. while |
@cronvel Hi, is there any demo in using the browser version? I can't get it working.
there is no process in the web.
How to reproduce the error: 2.Create a new project with default settings, install terminal-kit, and run
3.Open http://localhost:8080/ on your Chrome, currently, no error 4.Import terminal-kit in Home.vue
5.Check the console on your Chrome Develpment Tools (press F12 to open it on Chrome) |
You should use the build located in |
Hello,
I am currently exploring the integration of terminal-kit in a vue/webpack based project alongside xterm.js and commander.js for a pseudo webtty interface. However, webpack doesn't seem to play well with the lazy loading for this library.
Specifically, the vue/webpack dev server loads with an error
Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
and throwsCannot find module chroma-js
in the browser's console.I have tried adding
chroma-js
as an external dependency in webpack config but to no avail, any advice?The text was updated successfully, but these errors were encountered: