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

yarn dev: Internal server error: Cannot convert undefined or null to object #8

Closed
borisboguslavsky opened this issue Apr 30, 2022 · 1 comment

Comments

@borisboguslavsky
Copy link
Collaborator

Running yarn dev for me results in this error message:

4:16:45 PM [vite] Internal server error: Cannot convert undefined or null to object
      at Function.keys (<anonymous>)
      at transformIndexHtml (C:\Users\Boris\Dropbox\replicator\node_modules\vite-cep-plugin\lib\index.js:117:20)
      at applyHtmlTransforms (C:\Users\Boris\Dropbox\replicator\node_modules\vite\dist\node\chunks\dep-971d9e33.js:21713:27)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)
      at async viteIndexHtmlMiddleware (C:\Users\Boris\Dropbox\replicator\node_modules\vite\dist\node\chunks\dep-971d9e33.js:53300:28)

Commenting out the following code inside of index.js (line 117) works around this issue:

Object.keys(opts.bundle).filter(function (file) {
  if (file.includes("css")) {
    var newCode_1 = opts.bundle[file].source
      .replace(/\(\.\/assets/g, "(../assets")
      .replace(/\(\/assets/g, "(./");
    opts.bundle[file].source = newCode_1;
  }
});
@justintaylor-dev
Copy link
Contributor

Fixed in 0.1.6

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

No branches or pull requests

2 participants