You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a snippet grabbed from /packages/@lwc/rollup-plugin/src/index.ts:332
const [namespace, name] =
// Note we do not need to use path.sep here because this filename contains
// a '/' regardless of Windows vs Unix, since it comes from the Rollup `id`
specifier?.split('/') ?? #path.dirname(filename).split('/').slice(-2);
As per the comments, specifiers should only contain / as path delimiters. However, in my case (on Windows), I found them cometimes containing \ as well. Using /[\\/]/ here solves the problem for me.
BTW, extracting namespace and name from path.dirname(filename) also not working for relative filename like ./filename.css.
In theory this could be a bug in rollup itself, but looking at the changelogs for 4.29.1 (your version), 4.29.2, 4.30.0, 4.30.1 (latest), there's no clear indication that upgrading your version would fix it.
But just in case, are you able to upgrade to latest and confirm the issue still happens?
Description
Here's a snippet grabbed from
/packages/@lwc/rollup-plugin/src/index.ts
:332As per the comments, specifiers should only contain
/
as path delimiters. However, in my case (on Windows), I found them cometimes containing\
as well. Using/[\\/]/
here solves the problem for me.BTW, extracting
namespace
andname
frompath.dirname(filename)
also not working for relative filename like./filename.css
.Steps to Reproduce
Expected Results
No warning messages in the console regarding this reason.
Actual Results
Tons of these messages as each component may prompt one for js, html, and css each.
Version
"@lwc/rollup-plugin": "^8.12.2",
"lwc": "^8.12.2",
"rollup": "^4.29.1"
Possible Solution
Replace
.split('/')
with.split(/[\\/]/)
The text was updated successfully, but these errors were encountered: