We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
@parcel/resolver-default: External dependency "crypto" is not declared in package.json.
{ "name": "@scrypt/ssapp", "version": "1.0.0", "source": "src/index.js", "main": "dist/main.js", "module": "dist/module.js", "browser": "dist/browser.js", "types": "index.d.ts", "alias": { "process": "process/browser.js", "assert": "assert", "crypto": "crypto-browserify" }, "targets": { "types": false }, "scripts": { "watch": "parcel watch", "build": "parcel build --no-cache", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "description": "", "dependencies": { "assert": "^2.1.0", "crypto-browserify": "^3.12.0", "path-browserify": "^1.0.1", "process": "^0.11.10" }, "devDependencies": { "parcel": "^2.12.0" } }
Build success.
Build failed.
@parcel/core: Failed to resolve 'crypto' from './src/index.js'
C:\Users\myland\code\tmp\ssApp\src\index.js:2:28 1 | import { join } from "path";
2 | import { createHash } from 'crypto' | ^^^^^^^^ 3 | import { readFileSync } from 'fs' 4 | import assert from "assert";
C:\Users\myland\code\tmp\ssApp\package.json:26:3 25 | "description": "",
26 | "dependencies": { | ^^^^^^^^^^^^^^ 27 | "assert": "^2.1.0", 28 | "crypto-browserify": "^3.12.0",
💡 Add "crypto" as a dependency.
import { join } from "path"; import { createHash } from 'crypto' import { readFileSync } from 'fs' import assert from "assert"; export function add(a, b) { return a + b; } export function getaa() { return join("/asdfasdf/adfasdf", 'asdfas'); } export function myhash(str) { assert.deepEqual(str, "aa") console.log('myhash', str, process.env) console.log('aaa', readFileSync(join("aa", "aa.txt")).toString()) return createHash('sha256').update(str).digest('hex'); } export default { add, getaa, myhash }
The text was updated successfully, but these errors were encountered:
this error only happened when i use parcel version >= v2.9.0
Sorry, something went wrong.
No branches or pull requests
🐛 bug report
@parcel/resolver-default: External dependency "crypto" is not declared in package.json.
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
Build success.
😯 Current Behavior
Build failed.
@parcel/core: Failed to resolve 'crypto' from './src/index.js'
C:\Users\myland\code\tmp\ssApp\src\index.js:2:28
1 | import { join } from "path";
@parcel/resolver-default: External dependency "crypto" is not declared in package.json.
C:\Users\myland\code\tmp\ssApp\package.json:26:3
25 | "description": "",
💡 Add "crypto" as a dependency.
💁 Possible Solution
🔦 Context
💻 Code Sample
🌍 Your Environment
The text was updated successfully, but these errors were encountered: