framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.06k stars 3.23k forks source link

Error: with npm run build-cordova #4114

Closed octo8ight closed 1 year ago

octo8ight commented 1 year ago

Describe the bug

I created a new project with "framework7 create --ui" by selecting core for framework, cordova(Android, iOS) for platform, simple view and including all components with default themes.

After creating and installing "node modules" for this simple project, I was going to run this script: npm run build-cordova.

But there was an error I encountered.

The 7th, 8th lines of the file (./build/build-cordova.js) are

let entry = fs
    .readdirSync(path.resolve(__dirname, '../cordova/www/assets'))
    .filter((f) => f.includes('index.') && f.includes('.js'))[0];

const hash = entry.split('index.')[1].split('.js')[0];

But here, entry is undefined with your current release. So I changed them to

let entry = fs
    .readdirSync(path.resolve(__dirname, '../cordova/www/assets'))
    .filter((f) => f.includes('index-') && f.includes('.js'))[0];

const hash = entry.split('index-')[1].split('.js')[0];

And I replaced all 'index.' in this file to 'index-'. After that, I could build project.

amyounesi commented 1 year ago

me too