cancel
Showing results for 
Search instead for 
Did you mean: 

App Router Extension: how to remove xs-app.json?

hentoulau
Explorer
385

I’ve defined a route in my extension, passing the options object to the start()command, as described here
xsappContext - An object representing the content which is usually put in xs-app.json file. If this property is present it will take precedence over the content of xs-app.json.

As expected, my route, as defined in options, is being used by app router
So I thought I can remove the xs-app file which is not longer needed
But if I delete the xs-app.json file, then approuter throws an error on startup
This seems to be intended: in environment.js, there’s a check if the file is found

var xsappFile = path.join(wdir,'xs-app.json');
if (!fsUtils.isFile(xsappFile)) {
throw new Error('File not found ' + xsappFile);

I don’t understand why this file is still required, when I pass the route as option. Although I agree, config file is better, in my scenario I want to remove the file. Is there a way to get rid of it?

Kind Regards and thanks for advice

Accepted Solutions (1)

Accepted Solutions (1)

mariusobert
Developer Advocate
Developer Advocate

Hi Henri,

I don't have an answer to that question, it could be the intented behavior (which would be strange) or a bug. Please open a ticket for component "BC-XS-APR" to validate this.

hentoulau
Explorer

Hi mariusobert thanks for your reply!
I've commented out the check in my local node_modules folder - and the app router seems to works fine

Answers (0)