Skip to content

Upload function does not work on windows #2210

Open
@NielsRavn

Description

@NielsRavn

I cannot run the upload command in the movie test scenario from a windows machine.

I get the following error:
image

I figured out that its because the path in the manifest file has forward slashes, and the path fetched from the file system has backwards slash. If i change it contentful complains that im not following the correct regex.

const files = fs.readdirSync(buildFolder, { recursive: true, encoding: 'utf-8' });

reads: 'functions\index.js'
on a windows machine and the check here looks for exact 'functions/index.js'

const functionWithoutEntryFile = functions.find(({ path }) => !files.includes(path));

workaround for now is to run the upload command through a windows WSL ubuntu instalation.

for others with this issue you can enable wsl and run: wsl --install -d Ubuntu
then "cd /mnt/" eg "cd /mnt/d/testfiles"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions