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

sourceMap source file does not exist #325

Closed
jaywcjlove opened this issue Jan 1, 2022 · 3 comments
Closed

sourceMap source file does not exist #325

jaywcjlove opened this issue Jan 1, 2022 · 3 comments

Comments

@jaywcjlove
Copy link
Member

jaywcjlove commented Jan 1, 2022

⚠️ sourceMap source file does not exist. 1

WARNING in ./node_modules/codesandbox-import-utils/lib/api/define.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map 
from '/git-project/@uiw/react/react-codesandbox/node_modules/codesandbox-import-utils/src/api/define.ts' 
file: Error: ENOENT: no such file or directory, 
open '/git-project/@uiw/react/react-codesandbox/node_modules/codesandbox-import-utils/src/api/define.ts'

https://github.com/uiwjs/react-codesandbox/blob/2012811c8a8edcba05ea1498140f72b20d61882d/.kktrc.ts#L23-L28

⚠️ Do not need the following configuration, upgrade kkt to v7.0.3+.

export default (conf: Configuration, env: 'development' | 'production', options: LoaderConfOptions) => {
  // ....
  // ⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣⇣
  if (conf.module && conf.module.rules && conf.module.rules[0]) {
    const rules = conf.module.rules[0];
    if (typeof rules === 'object' && typeof rules.loader === 'string' && /source-map-loader/.test(rules.loader)) {
      ;(conf.module.rules[0] as any).exclude = /((@babel(?:\/|\\{1,2})runtime)|codesandbox-import-utils)/;
    }
  }
  // ⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡⇡
}

Originally posted by @jaywcjlove in #198 (comment)

Footnotes

  1. https://github.com/uiwjs/react-codesandbox/commit/e9d1c020fe5ca4d5a6e20dd60adf596e458f442f

@jaywcjlove
Copy link
Member Author

Upgrade kkt to v7.0.3

jaywcjlove added a commit to uiwjs/react-code-preview that referenced this issue Jan 1, 2022
Fix sourceMap source file does not exist.
kktjs/kkt#325
jaywcjlove added a commit to uiwjs/react-codesandbox that referenced this issue Jan 2, 2022
Failed to parse source map
kktjs/kkt#325
kktjs/kkt#323

Upgrade react-scripts to v5, Support Webpack 5.x
kktjs/kkt#198
@jaywcjlove
Copy link
Member Author

@jaywcjlove
Copy link
Member Author

"scripts": {
-  "start": "kkt start",
+  "start": "GENERATE_SOURCEMAP=false kkt start",
  "build": "kkt build",
  "test": "kkt test"
},

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

1 participant