+
Skip to content

mlly throws [error] The URL must be of scheme file when called with absolute path on windows #297

Open
@danielroe

Description

@danielroe

Environment

windows
mlly 1.7.3

Reproduction

danielroe/windows-reproductions#1

Describe the bug

When called with an absolute path on Windows, resolvePathSync fails.

Sample code:

import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'

import { resolvePathSync } from 'mlly'

resolvePathSync(
  resolve(fileURLToPath(import.meta.url), '../plugins/router'))
  { extensions: ['.ts', '.js'] }
)

full reproduction

Additional context

originally encountered in nuxt/nuxt#30540

Logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载