{"record":{"id":"a10f4a26a9f05a5a","repo":"parcel-bundler/parcel","slug":"the-import-path-filename-is-using-webpack-sp","errorCode":null,"errorMessage":"The @import path \"${filename}\" is using webpack specific syntax, which isn't supported by Parcel.\n\nTo @import files from node_modules, use \"${correctPath}\"","messagePattern":"The @import path \"(.+?)\" is using webpack specific syntax, which isn't supported by Parcel\\.\n\nTo @import files from node_modules, use \"(.+?)\"","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/transformers/less/src/LessTransformer.js","lineNumber":115,"sourceCode":"\nfunction resolvePathPlugin({asset, resolve}) {\n  return {\n    install(less, pluginManager) {\n      class LessFileManager extends less.FileManager {\n        supports() {\n          return true;\n        }\n\n        supportsSync() {\n          return false;\n        }\n\n        async loadFile(rawFilename, currentDirectory, options) {\n          let filename = rawFilename;\n\n          if (WEBPACK_ALIAS_RE.test(filename)) {\n            let correctPath = filename.replace(/^~/, '');\n            throw new Error(\n              `The @import path \"${filename}\" is using webpack specific syntax, which isn't supported by Parcel.\\n\\nTo @import files from node_modules, use \"${correctPath}\"`,\n            );\n          }\n\n          // Based on https://github.com/less/less.js/blob/master/packages/less/src/less-node/file-manager.js\n          let isAbsoluteFilename = this.isPathAbsolute(filename);\n          let paths = isAbsoluteFilename ? [''] : [currentDirectory];\n          if (options.paths) {\n            paths.push(...options.paths);\n          }\n\n          let prefixes = options.prefixes || [''];\n          let fileParts = this.extractUrlParts(filename);\n          let filePath;\n          let contents;\n\n          if (filename[0] !== '~') {\n            outer: for (let p of paths) {","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/parcel-bundler/parcel/blob/59484858a1a0bcbb71f74088956bb437a2db6505/packages/transformers/less/src/LessTransformer.js#L97-L133","documentation":"Thrown by @parcel/transformer-less's custom Less file manager (resolvePathPlugin) when an @import path matches WEBPACK_ALIAS_RE (/^~[^/]/), the webpack convention for resolving from node_modules (e.g. `@import '~bootstrap/less/variables';`). The error message includes the corrected path (the same string without the leading tilde) so the user can drop the `~`.","triggerScenarios":"Less @import (or url()) where the filename begins with `~` followed by a non-slash character — i.e. a bare package name. The custom LessFileManager.loadFile runs this check before delegating to Parcel's resolver.","commonSituations":"Porting a webpack-based CSS/Less project; copying @import statements from a Bootstrap/Tailwind Less quickstart that uses webpack tilde resolution; vendored Less that references node_modules with `~`.","solutions":["Remove the leading `~` from the @import path (the error message prints the exact replacement).","If the package needs resolution from node_modules, Parcel's resolver handles bare specifiers natively — no prefix needed.","Search the codebase for `@import '~` and `@import \"~` and update all occurrences."],"exampleFix":"// before\n@import '~bootstrap/less/variables';\n// after\n@import 'bootstrap/less/variables';","handlingStrategy":"validation","validationCode":"const WEBPACK_ALIAS_RE = /^~[^/]/;\nfunction scanLessImports(imports) {\n  return imports.filter(i => WEBPACK_ALIAS_RE.test(i.path));\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["When migrating, search for `@import '~` and `@import \"~` in all .less files.","Remember Parcel resolves bare specifiers from node_modules natively — no prefix needed."],"tags":["less","webpack","migration","import-syntax","css"],"backgroundTag":null,"analyzedSha":"59484858a1a0bcbb71f74088956bb437a2db6505","analyzedAt":"2026-08-13T04:06:35.925Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}