-
-
Notifications
You must be signed in to change notification settings - Fork 43
fix: cannot resolve @textea/dev-kit/utils
#134
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
Conversation
✅ Deploy Preview for any-viewer ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Temporary workaround if you have some build script that works for me: // Temporary workaround for https://github.com./TexteaInc/json-viewer/issues/133
let content = fs.readFileSync('./node_modules/@textea/json-viewer/dist/index.mjs', { encoding: 'utf8' })
let newContent = content
.replace('import { DevelopmentError } from \'@textea/dev-kit/utils\';', '')
.replace('DevelopmentError', 'Error')
fs.writeFileSync('./node_modules/@textea/json-viewer/dist/index.mjs', newContent, { encoding: 'utf8' })
content = fs.readFileSync('./node_modules/@textea/json-viewer/dist/index.js', { encoding: 'utf8' })
newContent = content
.replace(' require(\'@textea/dev-kit/utils\'),', '')
.replace(' \'@textea/dev-kit/utils\',', '')
.replace(' global["@textea/dev-kit/utils"],', '')
.replace('DevelopmentError', 'Error')
fs.writeFileSync('./node_modules/@textea/json-viewer/dist/index.js', newContent, { encoding: 'utf8' }) |
1 similar comment
Temporary workaround if you have some build script that works for me: // Temporary workaround for https://github.com./TexteaInc/json-viewer/issues/133
let content = fs.readFileSync('./node_modules/@textea/json-viewer/dist/index.mjs', { encoding: 'utf8' })
let newContent = content
.replace('import { DevelopmentError } from \'@textea/dev-kit/utils\';', '')
.replace('DevelopmentError', 'Error')
fs.writeFileSync('./node_modules/@textea/json-viewer/dist/index.mjs', newContent, { encoding: 'utf8' })
content = fs.readFileSync('./node_modules/@textea/json-viewer/dist/index.js', { encoding: 'utf8' })
newContent = content
.replace(' require(\'@textea/dev-kit/utils\'),', '')
.replace(' \'@textea/dev-kit/utils\',', '')
.replace(' global["@textea/dev-kit/utils"],', '')
.replace('DevelopmentError', 'Error')
fs.writeFileSync('./node_modules/@textea/json-viewer/dist/index.js', newContent, { encoding: 'utf8' }) |
@textea/dev-kit/utils
Codecov ReportBase: 87.91% // Head: 87.91% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #134 +/- ##
=======================================
Coverage 87.91% 87.91%
=======================================
Files 18 18
Lines 1903 1903
Branches 338 338
=======================================
Hits 1673 1673
Misses 230 230 Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I just hit the same issue, could this be merged? |
This fixes #133.
I think that it's because the dev-kit lib got put as a dev dependency, so when you npm install, it doesn't come along.
I think it's just an oopsie. Moving it from devDependencies to dependencies in package.json will fix this.
I think that a better fix will be to not even have this "DevelopmentError" in the code as it seems rather odd, but this at least fixes the issue.