hello! this is kind of a kotlin MPP and gradle question wrapped into one burrito. So we recently mov...
g
hello! this is kind of a kotlin MPP and gradle question wrapped into one burrito. So we recently moved all of our apps into a monorepo from separate github repos. we converted everything into a gradle mutli-module project so we could share dependencies more easily. the problem: before, the MPP app front-end (javascript) was easily debuggable because we could set breakpoints in the kotlinjs files directly in the inspector or in intellij ultimate. however, since moving things into a monorepo and sharing dependencies the path info seems to have broken and now the webpack server can’t find any of the kotlinjs files. it appears that the files are located but they all give webpack a 404 error. the path info in the old non monorepo setup looks very different from the new path info, which makes sense because as a result of sharing code and using a multimodule gradle project the build directory is now one level up. i’m curious if anyone has run into this issue and fixed it or if anyone has advice on what to try
to be clear the app RUNS fine but i can’t inspect the files i’m suspicious of the 
..
 in the webpack filepath
i
Usually monorepo should work with source maps. I just checked with new project. Do you have some custom webpack configurations in
webpack.config.d
?
g
Sorry I might have been unclear. We have a monorepo with multiple modules one of which is the mpp app. We also have a common dependencies app that the mpp app shares dependencies with. Is that the same setup you checked with a new project?
Also thank you for responding!
I will share the webpack config
here’s my project config
here are the webpack configs i have
Copy code
config.module.rules.push({
    test: /\.less$/,
    use: [
        { loader: 'style-loader' },
        { loader: 'css-loader' },
        { loader: 'less-loader',
            options: {
                lessOptions: {
                     modifyVars: {
                       'primary-color': '#8aeed4',
                       'link-color': '#8aeed4',
                       'border-radius-base': '4px',
                       'btn-primary-color': 'black',
                       'menu-dark-selected-item-icon-color': 'black',
                       'menu-dark-selected-item-text-color': 'black',
                     },
                    javascriptEnabled: true
                }
            }
        },
    ],

});
Copy code
const webpack = require('webpack')

config.plugins.push(new webpack.DefinePlugin({
      'process.env.ENV' : JSON.stringify(process.env.DEV_MODE)
}))
nothing modifying path
relevant portion of my gradle file
Copy code
js {
        browser {
            binaries.executable()
            webpackTask {
                cssSupport.enabled = true
            }
            runTask {
                devServer =
                    devServer
                        ?.copy(
                            devServer!!.inline,
                            devServer!!.lazy,
                            devServer!!.noInfo,
                            false,
                            devServer!!.overlay,
                            devServer!!.port,
                            proxy = mapOf("/api" to mapOf("target" to "<http://localhost:8081>")),
                            contentBase = devServer!!.contentBase
                        )
                cssSupport.enabled = true
            }
            testTask {
                useKarma {
                    useChromeHeadless()
                    webpackConfig.cssSupport.enabled = true
                }
            }
@Ilya Goncharov [JB] any ideas for this? Thanks
i
For now it seems pretty ok, could you please try to create new multi module project? And check if source mapping works at least in this case
g
So before I moved this project into this multi module setting it worked ok. It still works by itself when customer portal app is the project root. It just breaks when it gets moved to a submodule
@Ilya Goncharov [JB] I found an issue on youtrack that is the same as the one I’m having. https://youtrack.jetbrains.com/issue/KT-48891
here’s a sample project