Error while creating python package for extension

I am trying to create a Python package for my extension using Python build tool but I am facing the following error while generating the package:

installing to build\bdist.win-amd64\wheel
running install
running install_lib
running install_data
copying myextension\labextension\static\lib_index_js.b971081e1fe2ee7ef4ed.js.map -> build\bdist.win-amd64\wheel\myextension-0.1.0.data\data\share\jupyter\labextensions\myextension\static
copying myextension\labextension\static\style.js -> build\bdist.win-amd64\wheel\myextension-0.1.0.data\data\share\jupyter\labextensions\myextension\static
copying myextension\labextension\static\vendors-node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_cssW-7d5e6f.bdafcc2936bf2afb8035.js -> build\bdist.win-amd64\wheel\myextension-0.1.0.data\data\share\jupyter\labextensions\myextension\static
error: could not create 'build\bdist.win-amd64\wheel\myextension-0.1.0.data\data\share\jupyter\labextensions\myextension\static\vendors-node_modules_css-loader_dist_runtime_api_js-node_modules_css-loader_dist_runtime_cssW-7d5e6f.bdafcc2936bf2afb8035.js': No such file or directory

ERROR Backend subprocess exited when trying to invoke build_wheel

The strane thing is that the file that it complains is already present in this directory:
myextension\myextension\labextension\static

Can someone help me fix this issue?

Is it possible you’re running into the maximum path length on Windows?

I was able to solve this issue by cleaning my environment using this command jlpm clean:all and then creating the package using python -m build command. I am not sure if it’s the path length issue or maybe another locking issue holding up the file.