profile
viewpoint
Ives van Hoorne CompuIves @codesandbox Amsterdam, The Netherlands https://twitter.com/CompuIves Developer, traveler, tech enthusiast, working on codesandbox.io.

codesandbox/codesandbox-client 9449

An online IDE for rapid web development

codesandbox/codesandbox-importers 164

All importers & exporters for CodeSandbox

codesandbox/cli 96

Upload your templates to codesandbox with a single command 🏖️. This repo has been moved here: https://github.com/codesandbox-app/codesandbox-importers/tree/master/packages/cli

cerebral/webpack-packager 55

A service that packages DLL bundles and manifests

cerebral/webpack-dll 49

A service that converts a package into a DLL and manifest

CompuIves/codesandbox-monaco-editor 14

Custom Monaco editor for CodeSandbox

codesandbox/netlify-deploy 5

A service to deploy sites to netlify

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 40d9241ff89cc7f6430a14073ab5c46fdcbcee00

Fix showing a comment icon, even for non-comment sandboxes

view details

push time in 8 hours

pull request commentbabel/babel

Use Yarn 2

It's now removed! If you create an empty commit the build should succeed now.

nicolo-ribaudo

comment created time in 13 hours

issue commentcodesandbox/codesandbox-client

React project that works locally does not work in codesandbox

Great to hear!! Clicking the a tag works now for me! Maybe something changed, but if it still doesn't work for you, which browser are you using?

kentcdodds

comment created time in 15 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha b0cef799d64275aee6d847f16ba5e669ab7f793d

Remove validation on time

view details

push time in 15 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 02f32a9ae3921774d1d6800042484d17a6269754

Use new, faster oniguruma wasm library (#4308) * Use new, faster oniguruma wasm library * Fix typing * Fix more type issues * Fix types

view details

push time in 15 hours

delete branch codesandbox/codesandbox-client

delete branch : improve/syntax-highlighting

delete time in 15 hours

PR merged codesandbox/codesandbox-client

Use new, faster oniguruma wasm library

Thanks to the work from https://github.com/microsoft/vscode/pull/95958, we can use a new oniguruma library that results in 2-3x faster syntax highlighting.

+30 -5

2 comments

7 changed files

CompuIves

pr closed time in 15 hours

Pull request review commentcodesandbox/codesandbox-client

Control extension host based on container state

 export class VSCodeEffect {      setFs(this.sandboxFsSync.create(sandbox)); -    if (isFirstLoad) {-      this.sandboxFsSync.sync(() => {});-    } else {-      this.editorApi.extensionService.stopExtensionHost();-      this.sandboxFsSync.sync(() => {-        this.editorApi.extensionService.startExtensionHost();-      });+    return new Promise(resolve => {+      if (isFirstLoad) {+        // Do no start extension host

I don't 100% understand this one. It says "Do not start extension host", but in the else statement it actually stops it. 🤔

christianalfoni

comment created time in 15 hours

Pull request review commentcodesandbox/codesandbox-client

Control extension host based on container state

 export class VSCodeEffect {      setFs(this.sandboxFsSync.create(sandbox)); -    if (isFirstLoad) {-      this.sandboxFsSync.sync(() => {});-    } else {-      this.editorApi.extensionService.stopExtensionHost();-      this.sandboxFsSync.sync(() => {-        this.editorApi.extensionService.startExtensionHost();-      });+    return new Promise(resolve => {+      if (isFirstLoad) {+        // Do no start extension host+        this.sandboxFsSync.sync(resolve);+      } else {+        this.stopExtensionHost();+        this.sandboxFsSync.sync(resolve);+      }+    });+  }++  public startExtensionHost() {+    if (this.isRunningExtensionHost) {+      return;+    }+    this.editorApi.extensionService.startExtensionHost();+    this.isRunningExtensionHost = true;

We should probably find a better way to see if it's running in the future (because people can have their extension host crash etc.). But this is okay for now, maybe we should add a comment/todo to keep it in mind in the future.

christianalfoni

comment created time in 15 hours

Pull request review commentcodesandbox/codesandbox-client

Control extension host based on container state

 export const sandboxChanged: AsyncAction<{ id: string }> = withLoadApp<{     state.editor.modulesByPath = fs;   }); +  if (sandbox.featureFlags?.containerLsp) {

We start or stop based on the experiment?

christianalfoni

comment created time in 15 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 9fe58c43ba3fd0875663f12baa81d86c58ff6446

Fix renaming variable names with @ Fixes #4186

view details

push time in 15 hours

issue commentcodesandbox/codesandbox-client

Unexpected token '.'

Hey! Just saw this error, committed a fix for it which should be live in 20min

fantasticsoul

comment created time in 15 hours

issue closedcodesandbox/codesandbox-client

"Cannot instantiate an arrow function" all of sudden

🐛 bug report

Description of the problem

I have a demo of my package on CodeSandbox. The package is called "Simple React Lightbox". I never had any issue and the demo was working flawlessly on CodeSandbox. I recently updated my package and everything was working fine. Today I just updated some "plain text" (a caption on an image) and I got an error.

Cannot instantiate an arrow function

How has this issue affected you? What are you trying to accomplish?

I just updated some plain text in my project, I saved and all of sudden I have got this error which comes from "Simple React Lightbox". I never had this error before, I tried to uninstall the dependency or go back to a previous version and I still get the error (previous versions were working as well).

To make sure it had nothing to do with my project, I have tried to test it on a fresh installation of "create react app" and everything works as expected without any error.

I don't know if something has changed with the "CodeSandbox" but the issue wasn't happening before and it doesn't come from my dependency and I am not getting the error elsewhere.

Link to sandbox: link (optional)

https://codesandbox.io/s/simple-react-lightboxss-39wrb?file=/src/App.js

Your Environment

Software Name/Version
Сodesandbox https://codesandbox.io/s/simple-react-lightbox-39wrb?file=/src/index.js
Browser Chrome, Safari and FireFox
Operating System macOS Catalina 10.15.4 (19E287)

closed time in 15 hours

michelecocuccio

issue commentcodesandbox/codesandbox-client

"Cannot instantiate an arrow function" all of sudden

Hey, I'm sorry for the inconvenience of this. I found the issue, the transpiler has to add a "use strict"; when it converts an esmodule to commonjs. In your case the function

var Rc = (function() { }).bind(void 0)

Did not work, because in a strict environment this would actually become void 0, but if it's not strict this will be Window. Because of that a check failed.

I've added the fix now in this commit (https://github.com/codesandbox/codesandbox-client/commit/2c9a8f8cd85e41958a54ce49111c873a6e5e2ef9) and it should be live within 20 minutes.

michelecocuccio

comment created time in 15 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 2c9a8f8cd85e41958a54ce49111c873a6e5e2ef9

Add implicit "use strict" to files converted from esmodules

view details

push time in 15 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha da105b2974c6404560d0386eb32be3fc05d6e5c4

Fix types

view details

push time in 16 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha e22edd3d5940687fb248fcda541934d2ba68bacd

Fix notification action buttons

view details

push time in 17 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 6c8dd8fac1418bb489dd466edecb42d58e49e43f

Fix Vero Reidentify (#4311) * Fix vero reidentify * Make it work retroactively * Always reidentify if possible

view details

push time in 17 hours

delete branch codesandbox/codesandbox-client

delete branch : fix/vero-reidentify

delete time in 17 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha f80f2f71138769778714645dc829a54796d6e478

Always reidentify if possible

view details

push time in 17 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 1b34365dc1900c3d3c9654b01553b34bd90172eb

Make it work retroactively

view details

push time in 17 hours

create barnchcodesandbox/codesandbox-client

branch : fix/vero-reidentify

created branch time in 17 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 40dc0fcc08229177b6b07d6b7eb56f34a873491f

Fix more type issues

view details

push time in 18 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 481a64cba4bbe975cc8bfabe3145c25c03f093f4

Fix typing

view details

push time in 18 hours

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 95981d60e0ab2f301980d42044431fc26f97918a

Fix case with multiple const exports

view details

push time in a day

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 9ee2daa001ba7b6ffaa3277944342172e403426d

Fix bundler issues with scopes starting with a dash

view details

push time in a day

PR opened codesandbox/codesandbox-client

Use new, faster oniguruma wasm library

Thanks to the work from https://github.com/microsoft/vscode/pull/95958, we can use a new oniguruma library that results in 2-3x faster syntax highlighting.

+27 -4

0 comment

6 changed files

pr created time in a day

create barnchcodesandbox/codesandbox-client

branch : improve/syntax-highlighting

created branch time in a day

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha f92d952fea6149d581c9f58e4544e1f454fc1a9a

Fix typecheck

view details

push time in a day

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 5e01dd099948c6fcba7843b1d574d0c467526cf5

Fix hasLogIn

view details

push time in a day

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 6ddf10150ddf60a9b97d2ed3f0a695b56422940c

Update the notification

view details

push time in a day

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 052646a3612752f6aec401ce5cfb369a57da92b6

Append version 2 to the sign in url

view details

push time in a day

push eventcodesandbox/codesandbox-client

Siddharth Kshetrapal

commit sha aeab2e6f9963b50007ff864e24e89b5c640cd04d

Chromatic 2: project token is now a flag instead of process env (#4075)

view details

Ives van Hoorne

commit sha 50e9d4fc52b17f7f92af201a2d29020a23a5190a

Improve render performance (#4018)

view details

Ives van Hoorne

commit sha 12dd9e42333d52f3f4f91afbbe5cb463ddd2b189

Greatly improve file switching performance (#4076) * Greatly improve file switching performance * Don't update callback even if state changes

view details

Ives van Hoorne

commit sha 2a88cf9e5ff2ac54182356aeb92920586c1f33cd

Remove unnecessary calculations for rendering files (#4078) * Greatly improve file switching performance * Don't update callback even if state changes * Remove unnecessary property * Remove unnecessary change

view details

Ives van Hoorne

commit sha d4d6050a65f05ac49cf5d2d15c8899a0f5e47129

Fix automatically opening directories (#4080)

view details

Siddharth Kshetrapal

commit sha 55948a2e35364f179ff33c65e917c63a54be891e

Dashboard: List view (#4077)

view details

garethx

commit sha ad03b5074fefd3dd9af4450234c0f8d290493644

New assets for Chrome/Firefox extension (#4084) * Update description * Delete still2.png * Updated screenshot * Delete icon48.png * Delete icon16.png * Delete icon128.png * Updated Logo * Update Readme.md

view details

garethx

commit sha c3d6b9ed5cb77a14efd6626a96e50000a3af6be5

Update Readme.md

view details

garethx

commit sha 3af4104bb1394ce2886894a038b59bbd831b4263

Update Readme.md

view details

garethx

commit sha 222fcffe7c84fc920ed2733f16e4321352015dbc

Add link to custom node example

view details

Siddharth Kshetrapal

commit sha e66555dcd510624189287483bade2ac6f752af57

Dashboard: draggable cards! (#4091)

view details

Sara Vieira

commit sha 5490b4e8a63a67663b6f5efefef3832fb01f06ad

fix broken avatars

view details

Sara Vieira

commit sha b969252099fd9a698393ba8d1afdd4984ba14ef5

add fallback

view details

Utwo

commit sha dd84b07dc2115ba873efab2cac04e0f623d69be9

Update README.md (#4081)

view details

garethx

commit sha 21352dbbf4cfc556b88236f729640bd99fe3689c

Update importing doc with GitHubBox and Browser Extension options (#4092) * Update 2-importing.md * Update packages/homepage/content/docs/2-importing.md Co-authored-by: Michaël De Boey <info@michaeldeboey.be> * Update packages/homepage/content/docs/2-importing.md Co-authored-by: Michaël De Boey <info@michaeldeboey.be> * Update packages/homepage/content/docs/2-importing.md Co-authored-by: Michaël De Boey <info@michaeldeboey.be> * Update packages/homepage/content/docs/2-importing.md Co-authored-by: Michaël De Boey <info@michaeldeboey.be> * Update packages/homepage/content/docs/2-importing.md Co-authored-by: Michaël De Boey <info@michaeldeboey.be> Co-authored-by: Michaël De Boey <info@michaeldeboey.be>

view details

Arthur Denner

commit sha f6a67ee4a7628c7f22fca892a17dff82d56ae8fe

refactor(deployment): rename ZEIT Now to Vercel (#4087)

view details

Sara Vieira

commit sha b6c3b8f0af3eee439255ee589a20487411ba89ad

mention dev instead of start in terminal message (#3919)

view details

Siddharth Kshetrapal

commit sha 1bfd7722fbea4cfe4a8abae7e77593f2b56a8050

Remove old sidebar (#3922)

view details

Christian Alfoni

commit sha a59aa7c4a3101b4fadc0dc15b2e1c96276fac310

Hot reload (#4111)

view details

Sara Vieira

commit sha 59adfea4eca82ae52990bee87ca41a6791b58650

New Design for Sign-in (#4083)

view details

push time in a day

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 96a292686e9d654bf7aea8478d034e53f4754651

Support .mjs extension in all presets

view details

push time in 2 days

push eventcodesandbox/codesandbox-client

Christian Alfoni

commit sha 6b5d4be8f1c0c028f02d93e0275105b0b0726938

remove live notification (#4282)

view details

push time in 2 days

delete branch codesandbox/codesandbox-client

delete branch : remove-live-notification

delete time in 2 days

PR merged codesandbox/codesandbox-client

Reviewers
remove live notification

Codesandbox is live by default, so this message is just confusing, as noted from a user showing us git flow issues. We also have an indication at the top showing who else is in the session now.

+0 -5

3 comments

1 changed file

christianalfoni

pr closed time in 2 days

pull request commentcodesandbox/codesandbox-client

remove live notification

<3

christianalfoni

comment created time in 2 days

delete branch codesandbox/codesandbox-client

delete branch : fix/transpiling-export-default

delete time in 2 days

PR merged codesandbox/codesandbox-client

Fix how we transpile esmodule default

We used to do

const a = interopRequireDefault(require('a')).default

a()

Now it will be

const $csb_a = require('a');
const a = interopRequireDefault($csb_a);

a.default()

In case default has been changed (often in case of cyclic dependencies).

+40 -23

1 comment

4 changed files

CompuIves

pr closed time in 2 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha d2c413a15a858f447bd85c0128fe3a106dd92697

Update snapshots

view details

push time in 2 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha cc15b0aecd3e7b54f1fcb79e9c0bda17c3dd96bd

Update test name

view details

push time in 2 days

PR opened codesandbox/codesandbox-client

Fix how we transpile esmodule default

We used to do

const a = interopRequireDefault(require('a')).default

a()

Now it will be

const $csb_a = require('a');
const a = interopRequireDefault($csb_a);

a.default()

In case default has been changed (often in case of cyclic dependencies).

+40 -23

0 comment

4 changed files

pr created time in 2 days

create barnchcodesandbox/codesandbox-client

branch : fix/transpiling-export-default

created branch time in 2 days

issue commentcodesandbox/codesandbox-client

Could not find module in path

Ah wow, I know what the issue is, and have pushed a fix which should be live (again) in 20 minutes. You might need to clear your cache to see it work, there was an issue with our validation of the packager which made us use the commonjs version of the lib. Which doesn't work with the dynamic imports.

miukimiu

comment created time in 2 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 28406242b67020fb6d57ce39248b7391bc612dcf

Fix conversion of empty export statements

view details

push time in 2 days

push eventcodesandbox/dependency-packager

Ives van Hoorne

commit sha 1383ddbcd947e7cc41864c8b966ed1501b231e87

Fix typos

view details

push time in 2 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 3e1d64504e6e495490e41383a9208e6a33c65b97

Perf improvement

view details

push time in 2 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 61553eecdaf54f9642fb8e65e4d36d3da40b876c

Fix renaming exports for nested functions

view details

push time in 2 days

issue commentcodesandbox/codesandbox-client

ModuleNotFoundError with react-stick

This should be fixed now!

The strange thing was, this was working a couple weeks ago when we were demoing something using this library.

We recently moved our bundler to resolve module by default instead of main, exactly for the type of issue like this one. Local bundlers already resolve module by default, and because of that more and more packages referred to a main that didn't exist (which gave the same error as the one you're seeing here). From now on we support both!

mattfelten

comment created time in 2 days

issue commentcodesandbox/codesandbox-client

ModuleNotFoundError with react-pdf

This should be fixed now!

IsaacGHoward

comment created time in 2 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha b76a3b0f54c3a750cea0c90075f29aba533674b8

Fix esmodule conversion of files with reserved export keywords (#4285) * Fix esmodule conversion of files with reserved export keywords * Remove it.only * Fix test * Update test

view details

push time in 2 days

delete branch codesandbox/codesandbox-client

delete branch : fix/reserved-keyword

delete time in 2 days

issue closedcodesandbox/codesandbox-client

Unexpected token 'export'

🐛 bug report

Description of the problem

Hello CodeSandbox team! 👋

Yesterday after https://github.com/codesandbox/codesandbox-client/pull/4269 was merged we could finally link a codesandbox from our live documentation.

But today it stopped working and we are running into a different error:

  • Chrome: Unexpected token 'export'
  • Firefox: export declarations may only appear at top level of a module.

Not sure this issue is related with https://github.com/codesandbox/codesandbox-client/issues/4277.

Link to sandbox: https://codesandbox.io/s/xo3y5

Thanks!

closed time in 2 days

miukimiu

PR merged codesandbox/codesandbox-client

Fix esmodule conversion of files with reserved export keywords

If there's an esm file that defines exports, we first need to rename that variable as it's a reserved keyword in the world of commonjs.

Fixes https://github.com/codesandbox/codesandbox-client/discussions/4273. Fixes #4292

+45 -1

3 comments

4 changed files

CompuIves

pr closed time in 2 days

issue commentcodesandbox/codesandbox-client

Unexpected token 'export'

Hey! Yep, I think that's true. I just merged the PR that fixed it, which should be live within ~15min.

miukimiu

comment created time in 2 days

issue closedcodesandbox/codesandbox-client

ModuleNotFoundError with react-stick

🐛 bug report

Description of the problem

The project my team works on is using react-stick as a dependency and we recently noticed our project no longer works in CodeSandbox. We get a ModuleNotFoundError when loading it. Also tried importing it directly (see sandbox link below), and still getting the error.

Not sure if something changed recently with how CodeSandbox handles imports but this used to work fine. I also reported an issue with react-stick here https://github.com/signavio/react-stick/issues/84

How has this issue affected you? What are you trying to accomplish?

Our project can no longer be demoed in CodeSandbox. Pretty painful.

Link to sandbox: link (optional)

https://codesandbox.io/s/kind-chatterjee-id2c8?file=/src/App.js

Your Environment

Software Name/Version
Сodesandbox Whatever is live right now?
Browser Chrome 83.0.4103.61
Operating System MacOS

closed time in 2 days

mattfelten

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 25e47b45283eb74c0651e78817e5c3220c8f6f80

Use new packager that sanitizes badly configured npm packages that refer to files that don't exist (#4293)

view details

push time in 2 days

issue closedcodesandbox/codesandbox-client

ModuleNotFoundError with react-pdf

🐛 bug report

Description of the problem

Up until today I've been working on a project that utilizes @react-pdf/renderer but now as of today it has given me an error:

Could not find module in path: '@react-pdf/unicode-properties' relative to '/node_modules/@react-pdf/textkit/engines/scriptItemizer/index.js'

I know this is a codesandbox issue as I exported the project and it didn't get any errors locally.

How has this issue affected you? What are you trying to accomplish?

Prevents me from working on my project on codesandbox, which is a pain.

Link to sandbox: link (optional)

Link goes to an example I made to show the issue

Your Environment

Software Name/Version
Сodesandbox Latest
Browser Chrome 83.0.4103.61
Operating System Windows 10 Version 10.0.19041 Build 19041

closed time in 2 days

IsaacGHoward

delete branch codesandbox/codesandbox-client

delete branch : fix/faulty-packages

delete time in 2 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 64a4c44eca365e5eee4e33069a3799f67691fe44

Fix packageFilter

view details

Ives van Hoorne

commit sha 7a0ee10a7dda3bb8fc5bf89f3f2e46af96fced8e

improve esmodule check

view details

Ives van Hoorne

commit sha f8b4c6ed6330ae7c74c8c46e934afc64912edf4b

Make isESModule more restrictive

view details

Sara Vieira

commit sha ed4be1fa4d995118a645ec12c140a25901ccd7f5

Optimistic updates for deleting a template (#4290)

view details

Sara Vieira

commit sha 7c5e87213e65f0568963a70fd379d8b8749f1463

make deployments be whatever the person sends (#4289)

view details

Ives van Hoorne

commit sha 8f7e7224a48dc7d814db71278df9ff1bd423f889

Remove the packageFilter check

view details

Ives van Hoorne

commit sha 8061949ed914dda853e51d48092e2d960d71f89a

Update test

view details

Ives van Hoorne

commit sha afc5f613b78f23164571a3759554d0325a014bcb

Merge branch 'master' into fix/reserved-keyword

view details

push time in 2 days

create barnchcodesandbox/codesandbox-client

branch : fix/faulty-packages

created branch time in 2 days

IssuesEvent
IssuesEvent

push eventcodesandbox/dependency-packager

Ives van Hoorne

commit sha 1a553f9bc450eecbf42800d0c357fe589444a5b6

Sanitize package.json by removing invalid `module` fields

view details

push time in 2 days

issue commentcodesandbox/codesandbox-client

SyntaxError /src/App.js: Unexpected token 'export'

Now it's live, sorry for the delay!

ben-rogerson

comment created time in 3 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 8f7e7224a48dc7d814db71278df9ff1bd423f889

Remove the packageFilter check

view details

push time in 3 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha f8b4c6ed6330ae7c74c8c46e934afc64912edf4b

Make isESModule more restrictive

view details

push time in 3 days

issue commentcodesandbox/codesandbox-client

SyntaxError /src/App.js: Unexpected token 'export'

Ah yes, deploy failed, retrying now!

ben-rogerson

comment created time in 3 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 7a0ee10a7dda3bb8fc5bf89f3f2e46af96fced8e

improve esmodule check

view details

push time in 3 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 64a4c44eca365e5eee4e33069a3799f67691fe44

Fix packageFilter

view details

push time in 3 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha f3c1beaad03fcb6471184d8cd3fd0049889d74d1

Add a fallback to commonjs if esmodule is not found (#4283) * Add a fallback to commonjs if esmodule is not found * Fix convert esmodule

view details

Ives van Hoorne

commit sha ca7f2aa6aebfa32e0b1dcc497aa88ca2b1957ec6

Keep import order when transpiling (#4288)

view details

Ives van Hoorne

commit sha c62bdc7e77cdc9ff0ff97764245a717a8fff8f86

Merge branch 'master' into fix/reserved-keyword

view details

push time in 3 days

issue commentcodesandbox/codesandbox-client

Order of imports is reversed, breaks Prism imports

Thanks for the report! A fix should be live in around ~20min

layershifter

comment created time in 3 days

delete branch codesandbox/codesandbox-client

delete branch : fix/export-order

delete time in 3 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha ca7f2aa6aebfa32e0b1dcc497aa88ca2b1957ec6

Keep import order when transpiling (#4288)

view details

push time in 3 days

issue closedcodesandbox/codesandbox-client

Order of imports is reversed, breaks Prism imports

🐛 bug report

Description of the problem

ReferenceError
Prism is not defined

In our code we have following:

import * as Prism from 'prismjs/components/prism-core';
import * as PropTypes from 'prop-types';
import * as React from 'react';

// Order of PrismJS imports there is sensitive
import 'prismjs/components/prism-clike';
import 'prismjs/components/prism-json';
import 'prismjs/components/prism-markup';
import 'prismjs/components/prism-bash';
import 'prismjs/components/prism-javascript';
import 'prismjs/components/prism-jsx';

On CodeSandbox the order of imports is reversed:

image

How has this issue affected you? What are you trying to accomplish?

All our CodeSandboxes are broken :( Prism plugins rely on order (and they are not real CJS/ESM modules), but as you may see it's reversed for some reason.

Link to sandbox: link (optional)

Your Environment

Software Name/Version
Сodesandbox https://codesandbox.io/s/jynde
Browser Chrome
Operating System Windows

closed time in 3 days

layershifter

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha f3c1beaad03fcb6471184d8cd3fd0049889d74d1

Add a fallback to commonjs if esmodule is not found (#4283) * Add a fallback to commonjs if esmodule is not found * Fix convert esmodule

view details

Ives van Hoorne

commit sha 3f5fcf1b7009005262e0028941878ccc1fd03375

Merge branch 'master' into fix/export-order

view details

push time in 3 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha f3c1beaad03fcb6471184d8cd3fd0049889d74d1

Add a fallback to commonjs if esmodule is not found (#4283) * Add a fallback to commonjs if esmodule is not found * Fix convert esmodule

view details

push time in 3 days

delete branch codesandbox/codesandbox-client

delete branch : fix/module-import

delete time in 3 days

PR merged codesandbox/codesandbox-client

Add a fallback to commonjs if esmodule is not found

Apparently some npm packages refer to a file using "module": field but the file doesn't exist. We recently changed to resolving module by default because of the exact reason, but on the main field (main field was referring to a file that doesn't exist).

This is tricky, and unfortunately it's allowed to refer to files that don't exist. The only solution for this is by introducing a separate check that verifies if the file exists, and if it doesn't fall back to main. It's a performance hit (as we have to do this during file resolving, which happens on the main thread), but I don't see another way.

Fixes #4276 Fixes #4275

+84 -17

2 comments

9 changed files

CompuIves

pr closed time in 3 days

issue closedcodesandbox/codesandbox-client

ModuleNotFoundError with react-stick

🐛 bug report

Description of the problem

The project my team works on is using react-stick as a dependency and we recently noticed our project no longer works in CodeSandbox. We get a ModuleNotFoundError when loading it. Also tried importing it directly (see sandbox link below), and still getting the error.

Not sure if something changed recently with how CodeSandbox handles imports but this used to work fine. I also reported an issue with react-stick here https://github.com/signavio/react-stick/issues/84

How has this issue affected you? What are you trying to accomplish?

Our project can no longer be demoed in CodeSandbox. Pretty painful.

Link to sandbox: link (optional)

https://codesandbox.io/s/kind-chatterjee-id2c8?file=/src/App.js

Your Environment

Software Name/Version
Сodesandbox Whatever is live right now?
Browser Chrome 83.0.4103.61
Operating System MacOS

closed time in 3 days

mattfelten

issue closedcodesandbox/codesandbox-client

ModuleNotFoundError with react-pdf

🐛 bug report

Description of the problem

Up until today I've been working on a project that utilizes @react-pdf/renderer but now as of today it has given me an error:

Could not find module in path: '@react-pdf/unicode-properties' relative to '/node_modules/@react-pdf/textkit/engines/scriptItemizer/index.js'

I know this is a codesandbox issue as I exported the project and it didn't get any errors locally.

How has this issue affected you? What are you trying to accomplish?

Prevents me from working on my project on codesandbox, which is a pain.

Link to sandbox: link (optional)

Link goes to an example I made to show the issue

Your Environment

Software Name/Version
Сodesandbox Latest
Browser Chrome 83.0.4103.61
Operating System Windows 10 Version 10.0.19041 Build 19041

closed time in 3 days

IsaacGHoward

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 99eeca64395f85c359694a29372fd0365f54e106

Fix convert esmodule

view details

push time in 3 days

create barnchcodesandbox/codesandbox-client

branch : fix/export-order

created branch time in 3 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 333eb2b6826dfdde4311afa92664b287754e6253

Fix test

view details

push time in 3 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 7135d121fc8ea8597cec02299214b859c53205cf

Remove it.only

view details

push time in 3 days

PR opened codesandbox/codesandbox-client

Fix esmodule conversion of files with reserved export keywords

If there's an esm file that defines exports, we first need to rename that variable as it's a reserved keyword in the world of commonjs.

Fixes https://github.com/codesandbox/codesandbox-client/discussions/4273.

+42 -0

0 comment

3 changed files

pr created time in 3 days

create barnchcodesandbox/codesandbox-client

branch : fix/reserved-keyword

created branch time in 3 days

PR opened codesandbox/codesandbox-client

Add a fallback to commonjs if esmodule is not found

Apparently some node modules refer to a file using "module": field but the file doesn't exist. We recently changed to resolving module by default because of the exact reason, but on the main field (main field was referring to a file that doesn't exist).

This is tricky, and unfortunately it's allowed to refer to files that don't exist. The only solution for this is by introducing a separate check that verifies if the file exists, and if it doesn't fall back to main. It's a performance hit (as we have to do this during file resolving, which happens on the main thread), but I don't see another way.

+70 -10

0 comment

7 changed files

pr created time in 3 days

create barnchcodesandbox/codesandbox-client

branch : fix/module-import

created branch time in 3 days

issue commentcodesandbox/codesandbox-client

ModuleNotFoundError with react-pdf

Hm yes, this happens because the library with the issue has a module field that refers to a file that doesn't exist. So in this case the library is misconfigured.

I didn't expect this to happen this often, so I'm going to build a check and fallback (so if module file doesn't exist default to main).

IsaacGHoward

comment created time in 3 days

issue commentcodesandbox/codesandbox-client

SyntaxError /src/App.js: Unexpected token 'export'

Thanks for the report! I found the issue and have committed a fix now, it should be live in 20min.

ben-rogerson

comment created time in 3 days

push eventcodesandbox/codesandbox-client

Ives van Hoorne

commit sha 30306aa8e51eaa4de4299a7f400fae6ee7470e21

Improve our esmodule detection Fixes #4277

view details

push time in 3 days

more