"TypeError: $(...).tooltip is not a function" code example

Example 1: rails 6 TypeError: $(...).tooltip is not a function

const { environment } = require('@rails/webpacker');
const customConfig = require('./custom');
const webpack = require('webpack');

environment.plugins.append(
  'Provide',
  new webpack.ProvidePlugin({
    $: 'jquery/src/jquery',
    jQuery: 'jquery/src/jquery',
    Popper: ['popper.js', 'default']
  })
);
environment.config.merge(customConfig);

module.exports = environment;

Example 2: Uncaught TypeError: s(...).tooltip is not a function

<script src="/tdk/scripts/jquery.min.js"                type="text/javascript"></script>
    <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
    <script src="/tdk/scripts/bootstrap.js"                 type="text/javascript"></script>
    <script src="/tdk/scripts/jquery.dataTables.js"         type="text/javascript"></script>
    <script src="/tdk/scripts/dataTables.bootstrap.js"  type="text/javascript"></script>